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

Function optfn_tile_width

src/options.c:4385–4415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4383}
4384
4385staticfn int
4386optfn_tile_width(
4387 int optidx, int req, boolean negated,
4388 char *opts, char *op)
4389{
4390 if (req == do_init) {
4391 return optn_ok;
4392 }
4393 if (req == do_set) {
4394 /* WINCAP tile_width:nn */
4395 op = string_for_opt(opts, negated);
4396 if ((negated && op == empty_optstr)
4397 || (!negated && op != empty_optstr)) {
4398 iflags.wc_tile_width = negated ? 0 : atoi(op);
4399 } else if (negated) {
4400 bad_negation(allopt[optidx].name, TRUE);
4401 return optn_err;
4402 }
4403 return optn_ok;
4404 }
4405 if (req == get_val || req == get_cnf_val) {
4406 if (iflags.wc_tile_width)
4407 Sprintf(opts, "%d", iflags.wc_tile_width);
4408 else if (req == get_cnf_val)
4409 opts[0] = '\0';
4410 else
4411 Strcpy(opts, defopt);
4412 return optn_ok;
4413 }
4414 return optn_ok;
4415}
4416
4417staticfn int
4418optfn_traps(

Callers

nothing calls this directly

Calls 2

string_for_optFunction · 0.85
bad_negationFunction · 0.85

Tested by

no test coverage detected