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.
This commit is contained in:
PatR
2015-08-02 01:54:51 -07:00
parent 3db39ca221
commit 5e909d3b44
2 changed files with 10 additions and 4 deletions

View File

@@ -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();

View File

@@ -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 */