From e723710c82a5b42bea1f398cc1397c7c38819eb9 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 28 Oct 2004 03:16:24 +0000 Subject: [PATCH] petrified engulfer (display glitch & potential panic) From the newsgroup: if you were polymorped into a cockatrice and a trapper attempted to swallow you, the 't' displayed at its location would be left behind after it turned to stoned. This fixes that and a much more serious issue as well: if you were punished at the time, the game would panic on your next attempt to move because the ball&chain were left in limbo. There would also have been strangeness (monster sharing your location, stale u.ustuck setting) if the swallower was life-saved, but I didn't try to make that happen so am not sure how bad things would have been. --- doc/fixes34.4 | 4 ++++ src/mhitu.c | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 1c90981a5..33918a2df 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -57,6 +57,10 @@ destroying a worn item via dipping in burning oil would not unwear/unwield avoid a panic splitbill when shopkeeper is trapped by the door grammar tidbit for message given when eating tainted meat is also cannibalism gas spores shouldn't be described as "unable to attack" while hero is praying +incorrect screen display if engulfer gets turned to stone when trying to + swallow while hero is poly'd into cockatrice +panic on subsequent move if engulfer gets turned to stone and poly'd hero + also has attached ball&chain Platform- and/or Interface-Specific Fixes diff --git a/src/mhitu.c b/src/mhitu.c index bed5b1bc2..69a97f68b 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mhitu.c 3.4 2004/06/12 */ +/* SCCS Id: @(#)mhitu.c 3.4 2004/10/27 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1629,13 +1629,15 @@ gulpmu(mtmp, mattk) /* monster swallows you, or damage if u.uswallow */ boolean physical_damage = FALSE; if (!u.uswallow) { /* swallows you */ + int omx = mtmp->mx, omy = mtmp->my; + if (youmonst.data->msize >= MZ_HUGE) return(0); if ((t && ((t->ttyp == PIT) || (t->ttyp == SPIKED_PIT))) && sobj_at(BOULDER, u.ux, u.uy)) return(0); if (Punished) unplacebc(); /* ball&chain go away */ - remove_monster(mtmp->mx, mtmp->my); + remove_monster(omx, omy); mtmp->mtrapped = 0; /* no longer on old trap */ place_monster(mtmp, u.ux, u.uy); u.ustuck = mtmp; @@ -1671,9 +1673,16 @@ gulpmu(mtmp, mattk) /* monster swallows you, or damage if u.uswallow */ } if (touch_petrifies(youmonst.data) && !resists_ston(mtmp)) { - minstapetrify(mtmp, TRUE); - if (mtmp->mhp > 0) return 0; - else return 2; + /* put the attacker back where it started; + the resulting statue will end up there */ + remove_monster(mtmp->mx, mtmp->my); /* u.ux,u.uy */ + place_monster(mtmp, omx, omy); + minstapetrify(mtmp, TRUE); + /* normally unstuck() would do this, but we're not + fully swallowed yet so that won't work here */ + if (Punished) placebc(); + u.ustuck = 0; + return (mtmp->mhp > 0) ? 0 : 2; } display_nhwindow(WIN_MESSAGE, FALSE); -- 2.40.0