]> granicus.if.org Git - nethack/commitdiff
double undead turning
authornethack.rankin <nethack.rankin>
Sat, 23 Feb 2002 11:13:41 +0000 (11:13 +0000)
committernethack.rankin <nethack.rankin>
Sat, 23 Feb 2002 11:13:41 +0000 (11:13 +0000)
     From the newsgroup:  when an undead monster got killed by a wand
or spell of undead turning, if it left a corpse that corpse would be
hit by the same zap and was immediately revived.  This fix uses the
flag bits that were added to prevent objects that are dropped by a
polymorphed monster from being hit by the same polymorph zap.

     This also fixes a post-3.3.1 bug that produced "the <undead>
turns to flee" even when that monster had been killed by the turning
attack.  3.3.1 had the same bogus fleeing effect but didn't give any
message so it was unnoticeable.

doc/fixes34.0
src/mon.c
src/zap.c

index 6c14779852f18866dbd8cb98d5270ae0ecb3c0af..fc0913b8cb0951e38c7a9d054946f6438eac53ac 100644 (file)
@@ -437,6 +437,8 @@ throwing an artifact upwards will trigger artifact hit effects when it falls
 being hit by Fire Brand stops the turning-into-slime process
 monsters hitting other monsters can split puddings with weapons
 be consistent with checking for iron weapons when splitting puddings
+prevent corpses of undead creatures just killed by undead turning from being
+       instantly revived by the same undead turning attack
 
 
 Platform- and/or Interface-Specific Fixes
index 92163cda0bc8d0e9b760433127e9013ae34a6827..0664b7cab338972412639e50f893a86a9ff71355 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -238,6 +238,10 @@ register struct monst *mtmp;
        }
        /* All special cases should precede the G_NOCORPSE check */
 
+       /* if polymorph or undead turning has killed this monster,
+          prevent the same attack beam from hitting its corpse */
+       if (flags.bypasses) bypass_obj(obj);
+
        if (mtmp->mnamelth)
            obj = oname(obj, NAME(mtmp));
 
index 19242142dd62680e4424db538abaf1741be96581..aad71a8e3ad3fb561504817fd464df22d8c79b3c 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -166,8 +166,10 @@ struct obj *otmp;
                        if(dbldam) dmg *= 2;
                        if (otyp == SPE_TURN_UNDEAD)
                                dmg += spell_damage_bonus();
-                       if(!resist(mtmp, otmp->oclass, dmg, NOTELL))
-                           monflee(mtmp, 0, FALSE, TRUE);
+                       flags.bypasses = TRUE;  /* for make_corpse() */
+                       if (!resist(mtmp, otmp->oclass, dmg, NOTELL)) {
+                           if (mtmp->mhp > 0) monflee(mtmp, 0, FALSE, TRUE);
+                       }
                }
                break;
        case WAN_POLYMORPH:
@@ -186,12 +188,14 @@ struct obj *otmp;
                            pline("%s shudders!", Monnam(mtmp));
                            makeknown(otyp);
                        }
+                       /* flags.bypasses = TRUE; ## for make_corpse() */
                        /* no corpse after system shock */
                        xkilled(mtmp, 3);
-                   }
-                   else if (newcham(mtmp, (struct permonst *)0, (otyp != POT_POLYMORPH)) )
+                   } else if (newcham(mtmp, (struct permonst *)0,
+                                      (otyp != POT_POLYMORPH))) {
                        if (!Hallucination && canspotmon(mtmp))
                            makeknown(otyp);
+                   }
                }
                break;
        case WAN_CANCELLATION:
@@ -1435,6 +1439,10 @@ struct obj *obj, *otmp;
                 *             consistent with items that remain in the
                 *             monster's inventory. They are not polymorphed
                 *             either.
+                * UNDEAD_TURNING - When an undead creature gets killed via
+                *             undead turning, prevent its corpse from being
+                *             immediately revived by the same effect.
+                *
                 * The bypass bit on all objects is reset each turn, whenever
                 * flags.bypasses is set.
                 *