-$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.104 $ $NHDT-Date: 1567213888 2019/08/31 01:11:28 $
+$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.105 $ $NHDT-Date: 1567240693 2019/08/31 08:38:13 $
This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however,
instead of dying, make it revert to sandestin form with full health
toggling perm_invent (where supported) while swallowed or underwater didn't
necessarily update the persistent inventory window right away
+have 'O' update persistent inventory window if 'implicit_uncursed',
+ 'menucolors', or 'guicolors' (curses) is toggled or if menucolors is
+ On and any menu color patterns are added or removed
+'O's "set <option> to what?" could be used to force a buffer overflow
+'O's response to bad 'statuslines' value said "must be 2 and 3" (at one point
+ it was "must be between 2 and 3", change it to "must be 2 or 3")
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
what kind of monster?" prompt, resulting in "<x,y>" as default answer
EDIT_GETLIN: when naming an object or a monster use the existing name, if
there is one, as the default answer
+EDIT_GETLIN: using 'O' to set message types or menu colors was overloading the
+ answer buffer with other stuff, resulting in bogus default response
+ during repeat prompting
curses: very tall menus tried to use selector characters a-z, A-Z, and 0-9,
but 0-9 should be reserved for counts and if the display was tall
enough for more than 62 entries, arbitrary ASCII punctuation got used
-/* NetHack 3.6 options.c $NHDT-Date: 1561682566 2019/06/28 00:42:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.367 $ */
+/* NetHack 3.6 options.c $NHDT-Date: 1567240693 2019/08/31 08:38:13 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.369 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
itmp = atoi(op);
}
if (itmp < 2 || itmp > 3) {
- config_error_add("'%s' requires a value of 2 and 3", fullname);
+ config_error_add("'%s' requires a value of 2 or 3", fullname);
retval = FALSE;
} else {
iflags.wc2_statuslines = itmp;
status_initialize(REASSESS_ONLY);
context.botl = TRUE;
} else if (boolopt[i].addr == &flags.invlet_constant
- || boolopt[i].addr == &flags.sortpack) {
+ || boolopt[i].addr == &flags.sortpack
+ || boolopt[i].addr == &iflags.implicit_uncursed) {
if (!flags.invlet_constant)
reassign();
- if (iflags.perm_invent)
- update_inventory();
+ update_inventory();
} else if (boolopt[i].addr == &flags.lit_corridor
|| boolopt[i].addr == &flags.dark_room) {
/*
set_colors();
}
#endif
+ } else if (boolopt[i].addr == &iflags.use_menu_color
+ || boolopt[i].addr == &iflags.wc2_guicolor) {
+ update_inventory();
#endif /* TEXTCOLOR */
}
return retval;
doset() /* changing options via menu by Per Liboriussen */
{
static boolean made_fmtstr = FALSE;
- char buf[BUFSZ], buf2[BUFSZ] = DUMMY;
+ char buf[BUFSZ];
const char *name;
int i = 0, pass, boolcount, pick_cnt, pick_idx, opt_indx;
boolean *bool_p;
if (!special_handling(compopt[opt_indx].name, setinitial,
fromfile)) {
+ char abuf[BUFSZ];
+
Sprintf(buf, "Set %s to what?", compopt[opt_indx].name);
- getlin(buf, buf2);
- if (buf2[0] == '\033')
+ abuf[0] = '\0';
+ getlin(buf, abuf);
+ if (abuf[0] == '\033')
continue;
- Sprintf(buf, "%s:%s", compopt[opt_indx].name, buf2);
+ Sprintf(buf, "%s:", compopt[opt_indx].name);
+ (void) strncat(eos(buf), abuf,
+ (sizeof buf - 1 - strlen(buf)));
/* pass the buck */
(void) parseoptions(buf, setinitial, fromfile);
}
iflags.menu_headings = mhattr;
} else if (!strcmp("msgtype", optname)) {
int opt_idx, nmt, mttyp;
- char mtbuf[BUFSZ] = DUMMY;
+ char mtbuf[BUFSZ];
msgtypes_again:
nmt = msgtype_count();
if (opt_idx == 3) { /* done */
return TRUE;
} else if (opt_idx == 0) { /* add new */
+ mtbuf[0] = '\0';
getlin("What new message pattern?", mtbuf);
if (*mtbuf == '\033')
return TRUE;
}
} else if (!strcmp("menu_colors", optname)) {
int opt_idx, nmc, mcclr, mcattr;
- char mcbuf[BUFSZ] = DUMMY;
+ char mcbuf[BUFSZ];
menucolors_again:
nmc = count_menucolors();
opt_idx = handle_add_list_remove("menucolor", nmc);
if (opt_idx == 3) { /* done */
menucolors_done:
- if (nmc > 0 && !iflags.use_menu_color)
+ /* in case we've made a change which impacts current persistent
+ inventory window; we don't track whether an actual changed
+ occurred, so just assume there was one and that it matters;
+ if we're wrong, a redundant update is cheap... */
+ if (iflags.use_menu_color)
+ update_inventory();
+
+ /* menu colors aren't being used; if any are defined, remind
+ player how to use them */
+ else if (nmc > 0)
pline(
"To have menu colors become active, toggle 'menucolors' option to True.");
return TRUE;
+
} else if (opt_idx == 0) { /* add new */
+ mcbuf[0] = '\0';
getlin("What new menucolor pattern?", mcbuf);
if (*mcbuf == '\033')
goto menucolors_done;
wait_synch();
}
goto menucolors_again;
+
} else { /* list (1) or remove (2) */
int pick_idx, pick_cnt;
int mc_idx;