]> granicus.if.org Git - nethack/commitdiff
#R650: Game crash (Panic - obj not free)
authornethack.allison <nethack.allison>
Sat, 23 Mar 2002 01:35:59 +0000 (01:35 +0000)
committernethack.allison <nethack.allison>
Sat, 23 Mar 2002 01:35:59 +0000 (01:35 +0000)
> <email deleted>
> Oops! [...]
> Suddenly, the dungeon collapses.
> place_object: obj not free
>
> The crash is reproducible in wizmode by wishing for a landmine, arming it and
> pushing a wished-for boulder onto it.

doc/fixes34.1
src/explode.c
src/weapon.c

index 0a51e57bc7cc15dad7d611c17bce3f55398a0090..28ae8904d8973463b000ee11e70810b177847a05 100644 (file)
@@ -2,6 +2,7 @@ $RCSfile$ $Revision$ $Date$
 
 General Fixes and Modified Features
 -----------------------------------
+Prevent panic() obj_not_free when pushing a boulder over a landmine
 
 
 Platform- and/or Interface-Specific Fixes
index 05173ac666ea5ae1496fd37b004feda481bbacb0..66a66d908671feff30fb35e554583584c5861e78 100644 (file)
@@ -438,8 +438,9 @@ struct obj *obj;                    /* only scatter this obj        */
                        && rn2(10)) {
                if (otmp->otyp == BOULDER) {
                    pline("%s apart.", Tobjnam(otmp, "break"));
-                   fracture_rock(otmp);
-                   place_object(otmp, sx, sy); /* put fragments on floor */
+                   fracture_rock(otmp); /* the will place fragments on floor */
+                   obj_extract_self(otmp);
+                   place_object(otmp, sx, sy);
                    if ((otmp = sobj_at(BOULDER, sx, sy)) != 0) {
                        /* another boulder here, restack it to the top */
                        obj_extract_self(otmp);
index 1c94bd862d5587d804abdcae53d793bb0339ece7..a40bcb8d9a722cf235acf67b2098471cb814ab66 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)weapon.c   3.4     2002/02/07      */
+/*     SCCS Id: @(#)weapon.c   3.4     2002/03/22      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -871,7 +871,7 @@ enhance_weapon_skill()
            /* start with a legend if any entries will be annotated
               with "*" or "#" below */
            if (eventually_advance > 0 || maxxed_cnt > 0) {
-               any.a_int = 0;
+               any.a_void = 0;
                if (eventually_advance > 0) {
                    Sprintf(buf,
                            "(Skill%s flagged by \"*\" may be enhanced %s.)",