From 70b953db44ddf26da383fd90d484e507ce132a36 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Aug 2021 14:11:57 +0300 Subject: [PATCH] Clear bypasses at beginning of main loop 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/allmain.c b/src/allmain.c index 05e0e5a1f..65ee0bd91 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -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)