diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 386cac323..6bf827a35 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -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 diff --git a/include/extern.h b/include/extern.h index bdd94e641..5501505c5 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.7 extern.h $NHDT-Date: 1650875486 2022/04/25 08:31:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1109 $ */ +/* NetHack 3.7 extern.h $NHDT-Date: 1651886993 2022/05/07 01:29:53 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1112 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1622,7 +1622,7 @@ extern boolean itsstuck(struct monst *); extern boolean mb_trapped(struct monst *, boolean); extern boolean monhaskey(struct monst *, boolean); extern void mon_regen(struct monst *, boolean); -extern int dochugw(struct monst *); +extern int dochugw(struct monst *, boolean); extern boolean onscary(int, int, struct monst *); extern struct monst *find_pmmonst(int); extern int bee_eat_jelly(struct monst *, struct obj *); diff --git a/src/makemon.c b/src/makemon.c index f65019df7..61f6ca255 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 makemon.c $NHDT-Date: 1646694721 2022/03/07 23:12:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.199 $ */ +/* NetHack 3.7 makemon.c $NHDT-Date: 1651886995 2022/05/07 01:29:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.204 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1456,6 +1456,10 @@ makemon( : "", exclaim ? '!' : '.'); } + /* if discernable and a threat, stop fiddling while Rome burns */ + if (g.occupation) + (void) dochugw(mtmp, TRUE); + /* TODO: unify with teleport appears msg */ } diff --git a/src/mon.c b/src/mon.c index ed5060b99..603cc4370 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mon.c $NHDT-Date: 1650836671 2022/04/24 21:44:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.423 $ */ +/* NetHack 3.7 mon.c $NHDT-Date: 1651886997 2022/05/07 01:29:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.424 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1064,7 +1064,7 @@ movemon(void) && fightm(mtmp)) continue; /* mon might have died */ } - if (dochugw(mtmp)) /* otherwise just move the monster */ + if (dochugw(mtmp, FALSE)) /* otherwise just move the monster */ continue; } diff --git a/src/monmove.c b/src/monmove.c index bc8527cc0..722dfb7b5 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 monmove.c $NHDT-Date: 1603507386 2020/10/24 02:43:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.146 $ */ +/* NetHack 3.7 monmove.c $NHDT-Date: 1651886999 2022/05/07 01:29:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2006. */ /* NetHack may be freely redistributed. See license for details. */ @@ -109,14 +109,25 @@ watch_on_duty(register struct monst* mtmp) } } +/* move a monster; if a threat to busy hero, stop doing whatever it is */ int -dochugw(register struct monst* mtmp) +dochugw( + register struct monst *mtmp, + boolean dontchug) /* True: monster was just created, or maybe it has + * teleported; perform stop-what-you're-doing-if-close- + * enough-to-be-a-threat check but don't move mtmp */ { int x = mtmp->mx, y = mtmp->my; - boolean already_saw_mon = !g.occupation ? 0 : canspotmon(mtmp); - int rd = dochug(mtmp); + boolean already_saw_mon = ((dontchug || !g.occupation) ? 0 + : canspotmon(mtmp)); + int rd = dontchug ? 0 : dochug(mtmp); + + /* + * A similar check is in monster_nearby() in hack.c. + * [The two checks have a lot of differences and chances are high + * that some of those are unintentional.] + */ - /* a similar check is in monster_nearby() in hack.c */ /* check whether hero notices monster and stops current activity */ if (g.occupation && !rd /* monster is hostile and can attack (or hallu distorts knowledge) */