From f8fcaf8cbd7a7e67cadf702073e86551390796aa Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Mon, 28 May 2007 01:35:25 +0000 Subject: [PATCH] engulfing at dangerous location (trunk only) From a bug report, 2005: engulfers affected by conflict might swallow and kill monsters in pools (not mentioned: or lava or traps) and move to that spot, then not drown til next move. Make drowning and trap checks when engulf attack succeeds instead of waiting for next turn. [This was #2 of the 3 minor bugs; the others have already been fixed. They were: (1) placing and exploding a land mine on a lowered drawbridge would leave a pit instead of destroying the bridge; and (3) cause of death string "killed by Mr. Izchak, the shopkeeper" should omit "Mr.".] --- doc/fixes35.0 | 2 ++ src/mhitm.c | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 1d29c402e..ce95be87c 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -236,6 +236,8 @@ kick evasion and jousting/staggering blows shouldn't move grid bugs diagonally #untrap didn't check whether hero could reach the ground digging/chopping a closed drawbridge message mentioned digging a "wall" attacking via applied polearm now honors the "confirm" option +engulfer under influence of conflict or confusion could swallow monster at + water/lava/trap spot and not be affected by destination til next move Platform- and/or Interface-Specific Fixes diff --git a/src/mhitm.c b/src/mhitm.c index e8f88b499..31ae58c25 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -589,10 +589,9 @@ gulpmm(magr, mdef, mattk) status = mdamagem(magr, mdef, mattk); - if ((status & MM_AGR_DIED) && (status & MM_DEF_DIED)) { + if ((status & (MM_AGR_DIED|MM_DEF_DIED)) == (MM_AGR_DIED|MM_DEF_DIED)) { ; /* both died -- do nothing */ - } - else if (status & MM_DEF_DIED) { /* defender died */ + } else if (status & MM_DEF_DIED) { /* defender died */ /* * Note: remove_monster() was called in relmon(), wiping out * magr from level.monsters[mdef->mx][mdef->my]. We need to @@ -600,12 +599,13 @@ gulpmm(magr, mdef, mattk) */ place_monster(magr, dx, dy); newsym(dx, dy); - } - else if (status & MM_AGR_DIED) { /* agressor died */ + /* aggressor moves to and might encounter trouble there */ + if (minliquid(magr) || (t_at(dx, dy) && mintrap(magr) == 2)) + status |= MM_AGR_DIED; + } else if (status & MM_AGR_DIED) { /* aggressor died */ place_monster(mdef, dx, dy); newsym(dx, dy); - } - else { /* both alive, put them back */ + } else { /* both alive, put them back */ if (cansee(dx, dy)) pline("%s is regurgitated!", Monnam(mdef));