From 061f56492893c7ed6b954865c426b6a41e7b36c7 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 16 Aug 2024 11:40:12 -0700 Subject: [PATCH] monster display vs gas cloud regions This fixes the bug where a monster displayed instead of a gas cloud because the hero was next to it didn't revert to gas cloud when hero moved and was no longer next to the monster. --- doc/fixes3-7-0.txt | 4 +++- src/allmain.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 88a089184..8e801bdd9 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1460 $ $NHDT-Date: 1723410638 2024/08/11 21:10:38 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1461 $ $NHDT-Date: 1723833609 2024/08/16 18:40:09 $ General Fixes and Modified Features ----------------------------------- @@ -2008,6 +2008,8 @@ farlook of water/lava location listed wall of lava before molten lava; because having #terrain display gas cloud regions as if they were traps didn't work for monsters in such regions that are shown when adjacent to hero or sensed via ESP +when a monster within a gas cloud was displayed on the map because the hero + was next to it, it remained displayed if hero moved away Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/src/allmain.c b/src/allmain.c index 957763b8d..024867dc8 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 allmain.c $NHDT-Date: 1704225560 2024/01/02 19:59:20 $ $NHDT-Branch: keni-luabits2 $:$NHDT-Revision: 1.238 $ */ +/* NetHack 3.7 allmain.c $NHDT-Date: 1723833610 2024/08/16 18:40:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.258 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -425,11 +425,14 @@ moveloop_core(void) see_traps(); if (u.uswallow) swallowed(0); - } else if (Unblind_telepat) { + } else if (Unblind_telepat || Warning || Warn_of_mon + /* this is needed for the case where you saw a monster + due to being next to it while it's in a gas cloud + and then you moved away; it should no longer be seen + when that happens, even if it hasn't moved */ + || any_visible_region()) { /* TODO: optimize this */ see_monsters(); - } else if (Warning || Warn_of_mon) - see_monsters(); - + } if (gv.vision_full_recalc) vision_recalc(0); /* vision! */ }