B12002 - displacing pets thru narrow openings
authorcohrs <cohrs>
Mon, 14 Oct 2002 16:08:07 +0000 (16:08 +0000)
committercohrs <cohrs>
Mon, 14 Oct 2002 16:08:07 +0000 (16:08 +0000)
Add another check to domove to detect an attempt to displace a pet through
a narrow opening.

doc/fixes34.1
src/hack.c

index bdff0262df5ba0d4954b0892b100bc7b0a954e2b..12e960f40fffda79c5977f08649748f45047d642 100644 (file)
@@ -280,6 +280,7 @@ document "sound" option in Guidebook
 destroy traps that are buried by boulders dropped in water
 renamed debug commands: light sources -> lightsources,
        monpoly_control -> monpolycontrol
+detect attempt to swap places with big pet through narrow opening
 
 
 Platform- and/or Interface-Specific Fixes
index 739ef502c26742f58e8af018c970b6216b04ba6f..6731ebe4ad7370f9f602608e85e8e5c202863a02 100644 (file)
@@ -1279,6 +1279,13 @@ domove()
                    sobj_at(BOULDER, trap->tx, trap->ty)) {
                /* can't swap places with pet pinned in a pit by a boulder */
                u.ux = u.ux0,  u.uy = u.uy0;    /* didn't move after all */
+           } else if (u.ux0 != x && u.uy0 != y &&
+                      bad_rock(mtmp->data, x, u.uy0) &&
+                      bad_rock(mtmp->data, u.ux0, y) &&
+                      (bigmonst(mtmp->data) || (curr_mon_load(mtmp) > 600))) {
+               /* can't swap places when pet won't fit thru the opening */
+               u.ux = u.ux0,  u.uy = u.uy0;    /* didn't move after all */
+               You("stop.  %s won't fit through.", upstart(y_monnam(mtmp)));
            } else {
                char pnambuf[BUFSZ];