diff --git a/doc/fixes37.0 b/doc/fixes37.0 index f51073320..481ba0066 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.303 $ $NHDT-Date: 1600468452 2020/09/18 22:34:12 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.304 $ $NHDT-Date: 1600469617 2020/09/18 22:53:37 $ General Fixes and Modified Features ----------------------------------- @@ -250,6 +250,7 @@ end of game inventory disclosure passed an inappropriate argument to the turning into slime rendered hero as slime one turn too soon avoid potential infinite loop if hangup occurs at ring "right or left?" prompt randomize the turns where accessories and extrinsics affect nutrition +handle being interrupted by approaching monsters more consistently Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/hack.c b/src/hack.c index 583689adf..941643a12 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 hack.c $NHDT-Date: 1596498171 2020/08/03 23:42:51 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.267 $ */ +/* NetHack 3.7 hack.c $NHDT-Date: 1600469617 2020/09/18 22:53:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.268 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2971,10 +2971,10 @@ monster_nearby() continue; if ((mtmp = m_at(x, y)) && M_AP_TYPE(mtmp) != M_AP_FURNITURE && M_AP_TYPE(mtmp) != M_AP_OBJECT - && (!mtmp->mpeaceful || Hallucination) + && (Hallucination + || (!mtmp->mpeaceful && !noattacks(mtmp->data))) && (!is_hider(mtmp->data) || !mtmp->mundetected) - && !noattacks(mtmp->data) && mtmp->mcanmove - && !mtmp->msleeping /* aplvax!jcn */ + && mtmp->mcanmove && !mtmp->msleeping /* aplvax!jcn */ && !onscary(u.ux, u.uy, mtmp) && canspotmon(mtmp)) return 1; } diff --git a/src/monmove.c b/src/monmove.c index 87af97796..8842f1b66 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 monmove.c $NHDT-Date: 1596498186 2020/08/03 23:43:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.142 $ */ +/* NetHack 3.7 monmove.c $NHDT-Date: 1600469618 2020/09/18 22:53:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.143 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2006. */ /* NetHack may be freely redistributed. See license for details. */ @@ -114,16 +114,18 @@ register struct monst *mtmp; /* a similar check is in monster_nearby() in hack.c */ /* check whether hero notices monster and stops current activity */ - if (g.occupation && !rd && !Confusion && (!mtmp->mpeaceful || Hallucination) + if (g.occupation && !rd + /* monster is hostile and can attack (or hallu distorts knowledge) */ + && (Hallucination || (!mtmp->mpeaceful && !noattacks(mtmp->data))) /* it's close enough to be a threat */ - && distu(x, y) <= (BOLT_LIM + 1) * (BOLT_LIM + 1) + && distu(mtmp->mx, mtmp->my) <= (BOLT_LIM + 1) * (BOLT_LIM + 1) /* and either couldn't see it before, or it was too far away */ && (!already_saw_mon || !couldsee(x, y) || distu(x, y) > (BOLT_LIM + 1) * (BOLT_LIM + 1)) /* can see it now, or sense it and would normally see it */ - && (canseemon(mtmp) || (sensemon(mtmp) && couldsee(x, y))) - && mtmp->mcanmove && !noattacks(mtmp->data) - && !onscary(u.ux, u.uy, mtmp)) + && canspotmon(mtmp) && couldsee(mtmp->mx, mtmp->my) + /* monster isn't paralyzed or afraid (scare monster/Elbereth) */ + && mtmp->mcanmove && !onscary(u.ux, u.uy, mtmp)) stop_occupation(); return rd;