]> granicus.if.org Git - nethack/commitdiff
Clear bypasses at beginning of main loop
authorPasi Kallinen <paxed@alt.org>
Thu, 26 Aug 2021 11:11:57 +0000 (14:11 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 26 Aug 2021 11:12:00 +0000 (14:12 +0300)
Object bypass flag is used to check if an object was already
handled in an iteration loop, in cases where the linked list order
may change during iteration. The flags should never stay set
past a turn, if any were used.

Reset the bypass flags at the beginning of the main loop, without
checking g.context.move -flag; that flag gets reset if hero lifesaved.

src/allmain.c

index 05e0e5a1f16fdcbedb33b94a9282b4c0bb9fb11e..65ee0bd918d7c035eeaa1deeabe4504ee51b9b71 100644 (file)
@@ -153,6 +153,9 @@ moveloop_core(void)
         do_positionbar();
 #endif
 
+        if (g.context.bypasses)
+            clear_bypasses();
+
         if (g.context.move) {
             /* actual time passed */
             g.youmonst.movement -= NORMAL_SPEED;
@@ -359,8 +362,6 @@ moveloop_core(void)
             if (iflags.hilite_delta)
                 status_eval_next_unhilite();
 #endif
-            if (g.context.bypasses)
-                clear_bypasses();
             if (g.moves >= g.context.seer_turn) {
                 if ((u.uhave.amulet || Clairvoyant) && !In_endgame(&u.uz)
                     && !BClairvoyant)