]> granicus.if.org Git - nethack/commitdiff
wand of polymorph vs monster inventory
authornethack.rankin <nethack.rankin>
Fri, 25 May 2012 23:54:59 +0000 (23:54 +0000)
committernethack.rankin <nethack.rankin>
Fri, 25 May 2012 23:54:59 +0000 (23:54 +0000)
     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.

doc/fixes35.0
src/zap.c

index 5a57db94386dc3635e33c5a0ff10db767f3c151e..f4acb4cc003765e57159aa498203dc4f486aae97 100644 (file)
@@ -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
index 7743308b5f7b3d7f2a90b9a63a9a89b5faae0bf4..df7d3faace50ff5657c9768b0456c3fae9ec40c6 100644 (file)
--- 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);