]> granicus.if.org Git - nethack/commitdiff
Extract guard gold before disposing it
authorPasi Kallinen <paxed@alt.org>
Sat, 14 Nov 2015 15:41:27 +0000 (17:41 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 14 Nov 2015 15:41:31 +0000 (17:41 +0200)
If the gold is still in monster inventory, dealloc_obj will panic.

src/steal.c

index 94fcaca2e0ae32ced43a0a201b871746d5abfcb2..4b5378d960c662c8d8f25cbb81bbfbdf04d36f36 100644 (file)
@@ -676,6 +676,7 @@ boolean is_pet; /* If true, pet should keep wielded/worn items */
         if (canspotmon(mtmp))
             pline("%s gold %s.", s_suffix(Monnam(mtmp)),
                   canseemon(mtmp) ? "vanishes" : "seems to vanish");
+        obj_extract_self(otmp);
         obfree(otmp, (struct obj *) 0);
     } /* isgd && has gold */