fix issue #949 - dropping welded iron ball

If punished and the attached iron ball was both cursed and wielded,
falling while going down stairs would drop it instead of leaving it
welded to hero's hand. ( Didn't happen for iron ball that wasn't
chained to hero's leg.)

I thought that this was going to be a one or two line fix but ball
and chain stuff is never that simple.

Fixes #949
This commit is contained in:
PatR
2022-12-15 13:48:59 -08:00
parent 995fae39b5
commit df7e575500
4 changed files with 30 additions and 7 deletions

View File

@@ -1030,11 +1030,15 @@ void
weldmsg(struct obj *obj)
{
long savewornmask;
const char *hand = body_part(HAND);
if (bimanual(obj))
hand = makeplural(hand);
savewornmask = obj->owornmask;
pline("%s welded to your %s!", Yobjnam2(obj, "are"),
bimanual(obj) ? (const char *) makeplural(body_part(HAND))
: body_part(HAND));
obj->owornmask = 0L; /* suppress doname()'s "(weapon in hand)";
* Yobjnam2() doesn't actually need this because
* it is based on xname() rather than doname() */
pline("%s welded to your %s!", Yobjnam2(obj, "are"), hand);
obj->owornmask = savewornmask;
}