]> granicus.if.org Git - nethack/commitdiff
X11 build fix
authorPatR <rankin@nethack.org>
Wed, 6 Apr 2022 18:18:51 +0000 (11:18 -0700)
committerPatR <rankin@nethack.org>
Wed, 6 Apr 2022 18:18:51 +0000 (11:18 -0700)
The X11 interface wouldn't build if STATUS_HILITES was disabled.
Failure was due to post-3.6.x changes.

doc/fixes3-7-0.txt
win/X11/winstat.c

index 91ed1e987da83af7c575417c8261a15c532ac8c9..6cd6edb91339f29b696d112233e3dc4a598b3bdb 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.851 $ $NHDT-Date: 1648428942 2022/03/28 00:55:42 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.864 $ $NHDT-Date: 1649269126 2022/04/06 18:18:46 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -1168,6 +1168,7 @@ Windows: nhl_loadlua() was missing the RDBMODE argument on the [dlb_]fopen(),
        fseek(), ftell() and fread()
 Windows: when VIRTUAL_TERMINAL_SEQUENCES was not defined, the preprocessing
        would fail on consoletty.c
+X11: fix build failure if STATUS_HILITES is disabled
 X11: was still initializing map to 'stone' instead of 'unexplored' after they
        became separate glyphs
 X11: for text map without color, add support for black&white ice; draw it in
index ed7669bda2bafdf585869c1f599b30efed3c762d..6baf30ff3e81027c6a5f06dd08062f1053ba06f5 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 winstat.c       $NHDT-Date: 1646171629 2022/03/01 21:53:49 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.36 $ */
+/* NetHack 3.7 winstat.c       $NHDT-Date: 1649269127 2022/04/06 18:18:47 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.37 $ */
 /* Copyright (c) Dean Luick, 1992                                */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1986,12 +1986,17 @@ check_turn_events(void)
 {
     int i;
     struct X_status_value *sv;
+    int hilight_time = 1;
 
+#ifdef STATUS_HILITES
+    if (iflags.hilite_delta)
+        hilight_time = (int) iflags.hilite_delta;
+#endif
     for (sv = shown_stats, i = 0; i < NUM_STATS; i++, sv++) {
         if (!sv->set)
             continue;
 
-        if (sv->turn_count++ >= iflags.hilite_delta) {
+        if (sv->turn_count++ >= hilight_time) {
             /* unhighlights by toggling a highlighted item back off again,
                unless forced inverted by a status_hilite rule */
             if (!sv->inverted_hilite) {