MCPcopy Create free account
hub / github.com/NetHack/NetHack / optfn_pile_limit

Function optfn_pile_limit

src/options.c:3403–3435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3401}
3402
3403staticfn int
3404optfn_pile_limit(
3405 int optidx, int req, boolean negated,
3406 char *opts, char *op)
3407{
3408 if (req == do_init) {
3409 return optn_ok;
3410 }
3411 if (req == do_set) {
3412 /* pile limit: when walking over objects, number which triggers
3413 "there are several/many objects here" instead of listing them
3414 */
3415
3416 op = string_for_opt(opts, negated);
3417 if ((negated && op == empty_optstr)
3418 || (!negated && op != empty_optstr))
3419 flags.pile_limit = negated ? 0 : atoi(op);
3420 else if (negated) {
3421 bad_negation(allopt[optidx].name, TRUE);
3422 return optn_err;
3423 } else /* op == empty_optstr */
3424 flags.pile_limit = PILE_LIMIT_DFLT;
3425 /* sanity check */
3426 if (flags.pile_limit < 0)
3427 flags.pile_limit = PILE_LIMIT_DFLT;
3428 return optn_ok;
3429 }
3430 if (req == get_val || req == get_cnf_val) {
3431 Sprintf(opts, "%d", flags.pile_limit);
3432 return optn_ok;
3433 }
3434 return optn_ok;
3435}
3436
3437staticfn int
3438optfn_player_selection(

Callers

nothing calls this directly

Calls 2

string_for_optFunction · 0.85
bad_negationFunction · 0.85

Tested by

no test coverage detected