From: nethack.rankin Date: Fri, 25 May 2012 23:54:59 +0000 (+0000) Subject: wand of polymorph vs monster inventory X-Git-Tag: MOVE2GIT~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98a609a03b0cab3ae94496cb6a1148e9da3eefcf;p=nethack wand of polymorph vs monster inventory From the newsgroup: inventory dropped by a monster killed by system shock when zapped by a wand of polymorph is protected against being poly'd by that same zap, but worn/wielded equipment that's forced to be dropped due to being unusable in a transformed monster's new form was not. Not mentioned in the newsgroup, but also fixed: boulders dropped when a giant turns into a non-giant were also subject to the zap instead of protected. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5a57db943..f4acb4cc0 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -842,6 +842,8 @@ declining to attack a peaceful monster via kicking woke nearby monsters and make hero be immune from stinking cloud damage during successful prayer very fast hero would sometimes take two consecutive moves with very fast monsters then getting two moves, instead of interleaving the activity +when a monster zapped by polymorph drops inventory because of its new form, + don't let that same zap hit the dropped item(s) Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 7743308b5..df7d3faac 100644 --- a/src/zap.c +++ b/src/zap.c @@ -227,6 +227,11 @@ struct obj *otmp; it guard against involuntary polymorph attacks too... */ shieldeff(mtmp->mx, mtmp->my); } else if (!resist(mtmp, otmp->oclass, 0, NOTELL)) { + /* dropped inventory (due to death by system shock, + or loss of wielded weapon and/or worn armor due to + limitations of new shape) won't be hit by this zap */ + for (obj = mtmp->minvent; obj; obj = obj->nobj) + bypass_obj(obj); /* natural shapechangers aren't affected by system shock (unless protection from shapechangers is interfering with their metabolism...) */ @@ -235,9 +240,6 @@ struct obj *otmp; pline("%s shudders!", Monnam(mtmp)); learn_it = TRUE; } - /* dropped inventory shouldn't be hit by this zap */ - for (obj = mtmp->minvent; obj; obj = obj->nobj) - bypass_obj(obj); /* context.bypasses = TRUE; ## for make_corpse() */ /* no corpse after system shock */ xkilled(mtmp, 3);