From: Pasi Kallinen Date: Wed, 1 Apr 2020 09:20:14 +0000 (+0300) Subject: Fix iron ball being deallocated when saving X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=62538f8e625191965625200e62c4d204038d1def;p=nethack Fix iron ball being deallocated when saving When swallowed by an air elemental, going down into a pit placed the attached iron ball on the floor. Saving (or using #wizmakemap) then deallocated the iron ball. Check being swallowed before trying to go down. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 6af69fff2..cbc857b6b 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -95,6 +95,8 @@ hero polymorphed into a hider and hiding was not unhidden when teleporting impose tighter restraints on 'summon nasties', both for spellcasting monsters and post-Wizard harassment prevent swallowing monster ending up in a solid wall if it killed vault guard +fix attached ball getting deallocated if swallowed, going down into a pit, + and saving Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/do.c b/src/do.c index 31407013f..ef6bf5c6b 100644 --- a/src/do.c +++ b/src/do.c @@ -1012,6 +1012,14 @@ dodown() return 1; /* came out of hiding; might need '>' again to go down */ } + if (u.ustuck) { + You("are %s, and cannot go down.", + !u.uswallow ? "being held" : is_animal(u.ustuck->data) + ? "swallowed" + : "engulfed"); + return 1; + } + if (!stairs_down && !ladder_down) { trap = t_at(u.ux, u.uy); if (trap && (uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) { @@ -1027,13 +1035,6 @@ dodown() } } } - if (u.ustuck) { - You("are %s, and cannot go down.", - !u.uswallow ? "being held" : is_animal(u.ustuck->data) - ? "swallowed" - : "engulfed"); - return 1; - } if (on_level(&valley_level, &u.uz) && !u.uevent.gehennom_entered) { You("are standing at the gate to Gehennom."); pline("Unspeakable cruelty and harm lurk down there.");