]> granicus.if.org Git - nethack/commitdiff
animation of wielded statue
authornethack.rankin <nethack.rankin>
Fri, 26 Sep 2003 10:27:36 +0000 (10:27 +0000)
committernethack.rankin <nethack.rankin>
Fri, 26 Sep 2003 10:27:36 +0000 (10:27 +0000)
     Fix the reported bug of problems after casting stone-to-flesh spell
on self while wielding a statue.  Pointers for worn items weren't kept in
sync and various potential symptoms could occur (most easily visible one
being that ')' falsely reported the no longer existing statue as still
wielded; report stated that one crash was observed).  This bug predates
3.4.2 and was probably present ever since stone-to-flesh got introduced.

doc/fixes34.3
src/trap.c

index 4a998e193f4c674259e5b4016b3ff644f258de40..93218facdc3e934005a79e770bd0f33fa4b955f8 100644 (file)
@@ -31,6 +31,7 @@ manes are nonliving
 poles and grappling hook worked thru walls when wearing Eyes of the Overworld
 more tweaks to fog cloud behavior
 when dismounting by choice and unimpaired, try not to land on a boulder
+casting stone-to-flesh on self while wielding a statue caused problems
 
 
 Platform- and/or Interface-Specific Fixes
index bbbbfb5b6ce613d350799de68d76109504a2eed3..3521f685060eede0f6fd388f72decedeef047051 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)trap.c     3.4     2003/05/25      */
+/*     SCCS Id: @(#)trap.c     3.4     2003/09/25      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -446,6 +446,9 @@ int *fail_reason;
            return (struct monst *)0;
        }
 
+       /* in case statue is wielded and hero zaps stone-to-flesh at self */
+       if (statue->owornmask) remove_worn_item(statue, TRUE);
+
        /* allow statues to be of a specific gender */
        if (statue->spe & STATUE_MALE)
            mon->female = FALSE;
@@ -461,6 +464,7 @@ int *fail_reason;
        }
        m_dowear(mon, TRUE);
        delobj(statue);
+
        /* mimic statue becomes seen mimic; other hiders won't be hidden */
        if (mon->m_ap_type) seemimic(mon);
        else mon->mundetected = FALSE;