]> granicus.if.org Git - nethack/commitdiff
fix #Q417 - gelatinous cubes can engulf Rider corpses
authornethack.rankin <nethack.rankin>
Sun, 11 Feb 2007 03:59:08 +0000 (03:59 +0000)
committernethack.rankin <nethack.rankin>
Sun, 11 Feb 2007 03:59:08 +0000 (03:59 +0000)
     From a bug report:  gelatinous cubes
could engulf Rider corpses, allowing g.cube and cargo to be teleported
away without triggering corpse revival, or to be hit with theft attack by
poly'd hero to get the corpse into inventory so it could then be put into
a container in order to prevent revival (or to be destroyed via bag of
holding explosion or cursed access).

doc/fixes34.4
src/mon.c

index 0e92c370e6f18b912752cbcce4e5812fcc34aad3..3d0eade1663b03829a495a900c777808f870ed7c 100644 (file)
@@ -272,6 +272,7 @@ prevent very large number of objects in # inventory slot from causing
 !fixinv config was using arbitrary characters instead of # for invent overflow
 don't report death by petrification if cockatrice kills hero via HP loss
 Riders are immune to green slime
+Rider corpses can't be engulfed by gelatinous cubes
 wielding a cloak of magic resistance or gray dragon scales, or carrying one in
        alternate weapon or quiver inventory slot, conferred magic resistance
        to polymorphed hero
index ff02a58fa15ae6ed1daa8644517c49f63f97bcea..42f0371027c325f4c943723e83d480e259bc3f63 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -814,6 +814,12 @@ meatobj(mtmp)              /* for gelatinous cubes */
                /* in case it polymorphed or died */
                if (ptr != &mons[PM_GELATINOUS_CUBE])
                    return !ptr ? 2 : 1;
+           } else if (otmp->otyp == CORPSE &&
+                       is_rider(&mons[otmp->corpsenm])) {
+               /* Rider corpse will always pass the obj_resists() test above
+                  and not be eaten; we don't want it to be engulfed either */
+               (void)revive_corpse(otmp);
+            /* continue; -- regardless of whether it revived */
            } else if (otmp->oclass != ROCK_CLASS &&
                                    otmp != uball && otmp != uchain) {
                ++ecount;