fix #Q404 - monster wielding cursed corpse
From a bug report, applying a bullwhip towards a monster to try to steal its weapon would report that a cursed cockatrice corpse was welded to the monster's hands even though corpses wielded by the player never become welded. Code for monsters deciding what to wield knew that corpses don't weld; everywhere else seems to assume that they only wield weldable weapons. Add a routine to check whether a wielded item is welded, similar to what's done for the hero. I fixed a couple of other spots besides use_whip() but didn't hunt all over.
This commit is contained in:
10
src/wield.c
10
src/wield.c
@@ -855,4 +855,14 @@ register struct obj *obj;
|
||||
obj->owornmask = savewornmask;
|
||||
}
|
||||
|
||||
/* test whether monster's wielded weapon is stuck to hand/paw/whatever */
|
||||
boolean
|
||||
mwelded(obj)
|
||||
struct obj *obj;
|
||||
{
|
||||
/* caller is responsible for making sure this is a monster's item */
|
||||
if (obj && (obj->owornmask & W_WEP) && will_weld(obj)) return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*wield.c*/
|
||||
|
||||
Reference in New Issue
Block a user