From: PatR Date: Sat, 5 Jun 2021 22:17:55 +0000 (-0700) Subject: fix pull request #526 - 'menucolor' help message X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60cc48890bf16173daf5d81ab0dbfe960ccb449b;p=nethack 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 --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 1cad98681..0af4b1b24 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -702,6 +702,9 @@ applying a book to check readability treated novels as if they were spellbooks error (example was an attempt to interactively set bouldersym to an invalid value), the error reporting routine crashed via segfault lighting for baalz level defaulted to random and could end up being lit +when using 'O' to set menu color patterns, the reminder message that the + boolean menucolors option needs to be set to True for them to work + was sometimes given even when already True curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/src/options.c b/src/options.c index d04ab4ac4..f18433db0 100644 --- a/src/options.c +++ b/src/options.c @@ -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 */