]> granicus.if.org Git - nethack/commitdiff
more #H267 - cursed figurine auto-activation
authornethack.rankin <nethack.rankin>
Fri, 16 Mar 2007 02:40:21 +0000 (02:40 +0000)
committernethack.rankin <nethack.rankin>
Fri, 16 Mar 2007 02:40:21 +0000 (02:40 +0000)
     Figurine activation timer had the same problem as burning objects:
it didn't clear up worn object pointers when destroying the object.

doc/fixes34.4
src/apply.c

index 432aa4fefe49f1f8dc5f0634a8ef90891176bfd8..8cf3e37c6814f0283fd3e6fa1b8424e6b3aebc96 100644 (file)
@@ -339,6 +339,7 @@ make score file processing more bullet proof to avoid potential security issue
 towel equipped in weapon, alternate weapon, or quiver slot can be applied
 lit candle or potion of oil which burned out while equipped would leave stale
        weapon/alternate-weapon/quiver pointer that could cause panic or crash
+wielded/worn figurine which auto-transformed had same stale pointer bug
 
 
 Platform- and/or Interface-Specific Fixes
index 58c36bc454df3339efc8c0902fdb8047546c9d82..7c2ba769651149327adc3b047a1374faf3846d4a 100644 (file)
@@ -1852,8 +1852,12 @@ long timeout;
            }
        }
        /* free figurine now */
-       obj_extract_self(figurine);
-       obfree(figurine, (struct obj *)0);
+       if (carried(figurine)) {
+           useup(figurine);
+       } else {
+           obj_extract_self(figurine);
+           obfree(figurine, (struct obj *)0);
+       }
        if (redraw) newsym(cc.x, cc.y);
 }