From 4e38da7ed9592a769a4c1368d4f5bad02b3604af Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 16 Mar 2007 02:40:21 +0000 Subject: [PATCH] more #H267 - cursed figurine auto-activation 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 | 1 + src/apply.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 432aa4fef..8cf3e37c6 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/apply.c b/src/apply.c index 58c36bc45..7c2ba7696 100644 --- a/src/apply.c +++ b/src/apply.c @@ -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); }