]> granicus.if.org Git - nethack/commitdiff
fix for #H229
authornethack.allison <nethack.allison>
Mon, 11 Sep 2006 04:03:59 +0000 (04:03 +0000)
committernethack.allison <nethack.allison>
Mon, 11 Sep 2006 04:03:59 +0000 (04:03 +0000)
<Someone> wrote:
>>comments:
>>When you commit suicide with a potion of oil (lit), sometimes nethack
>>reports an `obj_is_local' error just after disclosing all the game
>>variables. This has been found in-game (don't ask) and reproduced in
>>wizard mode and in-game (start-scumming).
>
> 0) a neutral human wizard (the scrolls/spellbooks burning, potions boiling ;))
> 1) wish up 3 potions of oil (so that the 2 remaining will definitely kill you)
> 2) a'pply one of them
> 3) stand 1 square away from a wall, like "| @"
> 4) throw the lit potion into the wall (`h' in this case)
> 5) answer `yes' on all prompts.

The thrown potion of oil, which was extracted from any chain
during the throw, still had its timers attached when the call to
splatter_burning_oil() was made. If that killed the hero, a
panic would result during bones file creation (saving timers)
because (obj->where == OBJ_FREE) on the potion.

Remove the timer prior to splattering the oil inside.

doc/fixes34.4
src/dothrow.c

index 59d58ff68da795688648fcb1c1c8789a05e6a750..c0d0467d573a1a3563f2258ea2aa1747a853a575 100644 (file)
@@ -253,6 +253,8 @@ honor the never-in-hell flag when selecting random monster type for corpses,
        eggs, figurines, and statues created in Gehennom
 hero is not subject to light-based blindness while fainted from hunger
 engraving while underwater should use surface() which handles that case
+prevent obj_is_local panic during bones creation when splatter_burning_oil()
+       from a thrown potion of oil kills the hero
 
 
 Platform- and/or Interface-Specific Fixes
index 1f645e504568b46ba8a76b5f9df2329daea7a023..0a527b491ad10e68fbbf9ab59f90400c93e6bc6c 100644 (file)
@@ -1591,6 +1591,14 @@ boolean from_invent;
                        break;
                case POT_WATER:         /* really, all potions */
                        if (obj->otyp == POT_OIL && obj->lamplit) {
+                           /* splatter_burning_oil() could kill hero,
+                              and a timed obj with obj->where==0
+                              causes a problem during savebones() so
+                              get rid of the timer/lightsources on it now */
+                           if (obj->timed)
+                               obj_stop_timers(obj);
+                           if (obj_sheds_light(obj))
+                               del_light_source(LS_OBJECT, obj_to_any(obj));
                            splatter_burning_oil(x,y);
                        } else if (distu(x,y) <= 2) {
                            if (!breathless(youmonst.data) || haseyes(youmonst.data)) {