From 5e909d3b440a1a3dc79e35876a0fa5136d3878a1 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 2 Aug 2015 01:54:51 -0700 Subject: [PATCH] obj bypass: move vs turn Reported by ais; clearing object bypass bits once per turn isn't often enough. Clear them after the hero moves (which might be more than once in a turn) and before each monster moves (ditto) and after last monster moves. This might not be optimal but that shouldn't matter since it's usually a no-op. --- src/allmain.c | 6 +++--- src/mon.c | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/allmain.c b/src/allmain.c index 9ee1c3897..a60f2c4ac 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 allmain.c $NHDT-Date: 1432512767 2015/05/25 00:12:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.61 $ */ +/* NetHack 3.6 allmain.c $NHDT-Date: 1438505671 2015/08/02 08:54:31 $ $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -177,8 +177,6 @@ boolean resuming; /* once-per-turn things go here */ /********************************/ - if (context.bypasses) - clear_bypasses(); if (Glib) glibr(); nh_timeout(); @@ -361,6 +359,8 @@ boolean resuming; /* once-per-hero-took-time things go here */ /******************************************/ + if (context.bypasses) + clear_bypasses(); if ((u.uhave.amulet || Clairvoyant) && !In_endgame(&u.uz) && !BClairvoyant && !(moves % 15) && !rn2(2)) do_vicinity_map(); diff --git a/src/mon.c b/src/mon.c index 97456d4a5..fd3e16455 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mon.c $NHDT-Date: 1436232245 2015/07/07 01:24:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.181 $ */ +/* NetHack 3.6 mon.c $NHDT-Date: 1438505682 2015/08/02 08:54:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.182 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -622,6 +622,9 @@ movemon() if (vision_full_recalc) vision_recalc(0); /* vision! */ + /* reset obj bypasses before next monster moves */ + if (context.bypasses) + clear_bypasses(); if (minliquid(mtmp)) continue; @@ -665,6 +668,9 @@ movemon() if (any_light_source()) vision_full_recalc = 1; /* in case a mon moved with a light source */ + /* reset obj bypasses after last monster has moved */ + if (context.bypasses) + clear_bypasses(); dmonsfree(); /* remove all dead monsters */ /* a monster may have levteleported player -dlc */ -- 2.40.0