From: PatR Date: Mon, 29 Mar 2021 16:35:43 +0000 (-0700) Subject: pull request #465 - explding hero waking monsters X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e9fc3ddb327431fecbbf4488ecaad725c181ebb;p=nethack pull request #465 - explding hero waking monsters A polymorphed hero who exploded when attacking thin air would use a radius based on experience level rather than the fixed radius that the monster form itself used. When exploding at a monster it didn't wake other monsters at all. Fixes #465 --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 867d924d6..fce516d0a 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.488 $ $NHDT-Date: 1617034646 2021/03/29 16:17:26 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.489 $ $NHDT-Date: 1617035736 2021/03/29 16:35:36 $ General Fixes and Modified Features ----------------------------------- @@ -423,6 +423,9 @@ if player managed to get multiple $ items, all but the last could be moved to when a monster on the far side of a closed door opens it, sometimes the hero was told about the monster without it being displayed on the map also show extended command name when showing what a key does in help +poly'd hero who exploded when attacking a monster didn't wake up other + monsters in the vicinity; when attacking thin air, hero's explosion + woke other monsters within different radius than same monster's would Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/hack.c b/src/hack.c index abf492d89..4e1aa363a 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 hack.c $NHDT-Date: 1609442596 2020/12/31 19:23:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.276 $ */ +/* NetHack 3.7 hack.c $NHDT-Date: 1617035736 2021/03/29 16:35:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.281 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1751,7 +1751,8 @@ domove_core(void) nomul(0); if (explo) { - wake_nearby(); + /* no monster has been attacked so we have bypassed explum() */ + wake_nearto(u.ux, u.uy, 7 * 7); /* same radius as explum() */ u.mh = -1; /* dead in the current form */ rehumanize(); } diff --git a/src/uhitm.c b/src/uhitm.c index f6718af89..ac55059b0 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 uhitm.c $NHDT-Date: 1614811212 2021/03/03 22:40:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.299 $ */ +/* NetHack 3.7 uhitm.c $NHDT-Date: 1617035737 2021/03/29 16:35:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.300 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4063,16 +4063,18 @@ damageum( mdef->mstrategy &= ~STRAT_WAITFORU; /* in case player is very fast */ mdef->mhp -= mhm.damage; if (DEADMONSTER(mdef)) { + /* (DEADMONSTER(mdef) and !mhm.damage => already killed) */ if (mdef->mtame && !cansee(mdef->mx, mdef->my)) { You_feel("embarrassed for a moment."); if (mhm.damage) - xkilled(mdef, XKILL_NOMSG); /* !mhm.damage but hp<1: already killed */ + xkilled(mdef, XKILL_NOMSG); } else if (!flags.verbose) { You("destroy it!"); if (mhm.damage) xkilled(mdef, XKILL_NOMSG); - } else if (mhm.damage) - killed(mdef); + } else if (mhm.damage) { + killed(mdef); /* regular "you kill " message */ + } return MM_DEF_DIED; } return MM_HIT; @@ -4126,6 +4128,7 @@ explum(struct monst *mdef, struct attack *mattk) default: break; } + wake_nearto(u.ux, u.uy, 7 * 7); /* same radius as exploding monster */ return MM_HIT; } @@ -4746,7 +4749,8 @@ hmonas(struct monst *mon) (void) passive(mon, weapon, 1, 0, mattk->aatyp, FALSE); nsum = MM_MISS; /* return value below used to be 'nsum > 0' */ } else { - (void) passive(mon, weapon, (sum[i] != MM_MISS), 1, mattk->aatyp, FALSE); + (void) passive(mon, weapon, (sum[i] != MM_MISS), 1, + mattk->aatyp, FALSE); nsum |= sum[i]; }