fix pull request #526 - 'menucolor' help message

being given when it shouldn't be.  A change for perm_invent handling
back in March screwed up the if/then/else logic for code executed
when finishing MENUCOLOR manipulation via the 'O' command.  That
resulted in the reminder to set menucolors to True being given even
when it was already True if perm_invent happened to be False.

I noticed this myself recently, then neglected to investigate it or
even write it down anywhere.

Fixes #526
This commit is contained in:
PatR
2021-06-05 15:17:55 -07:00
parent 5c15ca1002
commit 60cc48890b
2 changed files with 10 additions and 5 deletions

View File

@@ -5049,14 +5049,16 @@ handler_menu_colors(void)
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 && iflags.perm_invent)
update_inventory();
if (iflags.use_menu_color) {
if (iflags.perm_invent)
update_inventory();
/* menu colors aren't being used; if any are defined, remind
player how to use them */
else if (nmc > 0)
/* menu colors aren't being used yet; if any MENUCOLOR rules are
defined, remind player how to activate them */
} else if (nmc > 0) {
pline(
"To have menu colors become active, toggle 'menucolors' option to True.");
}
return optn_ok;
} else if (opt_idx == 0) { /* add new */