]> granicus.if.org Git - nethack/commitdiff
fix #H7655 - highlighting gold
authorPatR <rankin@nethack.org>
Fri, 7 Dec 2018 08:36:38 +0000 (00:36 -0800)
committerPatR <rankin@nethack.org>
Fri, 7 Dec 2018 08:36:38 +0000 (00:36 -0800)
With options along the line of
 OPTIONS=statushilites:4
 HILITE_STATUS=gold/always/yellow
gold started out unhighlighted (unhighlit?).  I didn't try to figure
out why, just changed things to force a full status update when gold
requires internal changes (different \G encoding or different glyph)
which is something that happens when session first enters moveloop().

doc/fixes36.2
src/botl.c

index 421792d3869949fd9b331d5c7f3656a423aaf863..68d6c3229c74d9d1c9b5afbcf6023ba8966b396c 100644 (file)
@@ -252,6 +252,7 @@ hero hit by something that causes inventory items to be destroyed with loss of
        similar problem with more obvious symptom, an "object lost" panic when
        the unholy water was wielded; the fix for that wasn't general enough]
 add MM_ASLEEP makemon() flag and honor it when creating group for fill_zoo
+at start of session (new game or restore), HILITE_STATUS for gold was ignored
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index 4af7491057a46286423d795adbf65879643894ac..e0008d2b5bf05873cdfe55cad941fcf2ae6e14c5 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 botl.c  $NHDT-Date: 1527042178 2018/05/23 02:22:58 $  $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.101 $ */
+/* NetHack 3.6 botl.c  $NHDT-Date: 1544171789 2018/12/07 08:36:29 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.128 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Michael Allison, 2006. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -732,15 +732,14 @@ boolean *valsetlist;
      *  NNNN = the glyph portion
      *  25   = the gold amount
      *
+     * Setting 'chg = 2' is enough to render the field properly, but
+     * not to honor an initial highlight, so force 'update_all = 1'.
      */
-
     if (fld == BL_GOLD) {
-        if (context.rndencode != oldrndencode) {
-            chg = 2;
+        if (context.rndencode != oldrndencode
+            || showsyms[COIN_CLASS + SYM_OFF_O] != oldgoldsym) {
+            update_all = 1; /* chg = 2; */
             oldrndencode = context.rndencode;
-        }
-        if (oldgoldsym != showsyms[COIN_CLASS + SYM_OFF_O]) {
-            chg = 2;
             oldgoldsym = showsyms[COIN_CLASS + SYM_OFF_O];
         }
     }