animation of wielded statue

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.
This commit is contained in:
nethack.rankin
2003-09-26 10:27:36 +00:00
parent 0ee0cc96da
commit 0288c5321a
2 changed files with 6 additions and 1 deletions

View 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

View 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;