#endif
/* B:nm, ln, opt_*, setwhere?, on?, negat?, val?, dup?, hndlr? Alias, boolptr */
-/* C:nm, ln, opt_*, setwhere?, on?, negat?, val?, dup?, hndlr? Alias, descr */
-/* P:pfx, ln, opt_*, setwhere?, on?, negat?, val?, dup?, hndlr? Alias, descr */
+/* C:nm, ln, opt_*, setwhere?, negateok?, valok?, dupok?, hndlr? Alias, desc */
+/* P:pfx, ln, opt_*, setwhere?, negateok?, valok?, dupok?, hndlr? Alias, desc*/
NHOPTB(acoustics, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias,
&flags.acoustics)
"video height")
#endif
#ifdef TTY_TILES_ESCCODES
- NHOPTB(vt_tiledata, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias,
+ NHOPTB(vt_tiledata, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias,
&iflags.vt_tiledata)
#else
- NHOPTB(vt_tiledata, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias,
+ NHOPTB(vt_tiledata, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias,
(boolean *) 0)
#endif
NHOPTC(warnings, 10, opt_in, set_in_config, No, Yes, No, No, NoAlias,
#endif
static char empty_optstr[] = { '\0' };
-boolean duplicate;
+boolean duplicate, using_alias;
static const char def_inv_order[MAXOCLASSES] = {
COIN_CLASS, AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS,
boolean retval = TRUE;
duplicate = FALSE;
+ using_alias = FALSE;
g.opt_initial = tinitial;
g.opt_from_file = tfrom_file;
if ((op = index(opts, ',')) != 0) {
allopt[i].valok);
if (got_match) {
matchidx = i;
+ using_alias = TRUE;
break;
}
}
if (!g.opt_initial && (allopt[optidx].setwhere == set_in_config))
return optn_err;
- /* 0 means boolean opts */
- if (duplicate_opt_detection(optidx))
- complain_about_duplicate(optidx);
-
op = string_for_opt(opts, TRUE);
if (op != empty_optstr) {
if (negated) {
int optidx;
{
if (g.opt_initial && g.opt_from_file)
- return allopt[optidx].dupdetected;
+ return allopt[optidx].dupdetected++;
return FALSE;
}
complain_about_duplicate(optidx)
int optidx;
{
+ char buf[BUFSZ];
+
#ifdef MAC
/* the Mac has trouble dealing with the output of messages while
* processing the config file. That should get fixed one day.
* For now just return.
*/
#else /* !MAC */
- config_error_add("%s option specified multiple times: %s",
+ buf[0] = '\0';
+ if (using_alias)
+ Sprintf(buf, " (via alias: %s)", allopt[optidx].alias);
+ config_error_add("%s option specified multiple times: %s%s",
(allopt[optidx].opttyp == CompOpt) ? "compound" : "boolean",
- allopt[optidx].name);
+ allopt[optidx].name, buf);
#endif /* ?MAC */
return;
}
return FALSE;
}
} else {
- if (duplicate_opt_detection(optidx))
+ if (duplicate && !allopt[optidx].dupeok)
complain_about_duplicate(optidx);
*opp = op;
return TRUE;