busy hero ignoring monster threat

Fix the problem reported by entrez of a zombie corpse reviving and
crawling out of the ground while the hero was busy doing something
(searching, digging, &c) and having the hero fail to react and just
keep doing whatever the thing was because the zombie was already
inside the range where a monster changes from no-threat to threat.

Done in the monster creation routine so any new monster (including
one revived from a corpse) that is visible,&c will cause the hero's
action to be interrupted.  Teleport arrival probably needs this too.

Only interrupts an occupation, not other voluntary multi-turn
actitivy such as running or traveling.  That would be trivial to
change ['if (g.occupation...' to 'if ((g.occupation || multi > 0)...']
but I'm not sure whether it ought to be extended to that.
This commit is contained in:
PatR
2022-05-06 18:30:06 -07:00
parent 02207b967a
commit f2f2644e30
5 changed files with 29 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.903 $ $NHDT-Date: 1651298443 2022/04/30 06:00:43 $
HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.906 $ $NHDT-Date: 1651886993 2022/05/07 01:29:53 $
General Fixes and Modified Features
-----------------------------------
@@ -1198,6 +1198,9 @@ using #wizmakemap on Plane of Water added a new set of air bubbles each time
with clouds on Plane of Air
avoid new "where are we?" panic if player quits during character selection
add Untrap as a potential 'autounlock' action
if a zombie revived near the hero, a busy hero would keep doing whatever
action was in progress instead of stopping because the zombify didn't
walk across the threshold from no-threat to threat
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support