]> granicus.if.org Git - nethack/commitdiff
Fix iron ball being deallocated when saving
authorPasi Kallinen <paxed@alt.org>
Wed, 1 Apr 2020 09:20:14 +0000 (12:20 +0300)
committerPasi Kallinen <paxed@alt.org>
Wed, 1 Apr 2020 09:20:18 +0000 (12:20 +0300)
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.

doc/fixes37.0
src/do.c

index 6af69fff2bddc650044f342c69ed810b9ef590d4..cbc857b6b96e816792dc00d5916c3318bf8893ae 100644 (file)
@@ -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
index 31407013f1e88902e446db0b0d105cbe225627df..ef6bf5c6bbe49db3a695308432304bf91c9a1f63 100644 (file)
--- 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.");