diff --git a/doc/fixes34.1 b/doc/fixes34.1 index bdff0262d..12e960f40 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/hack.c b/src/hack.c index 739ef502c..6731ebe4a 100644 --- a/src/hack.c +++ b/src/hack.c @@ -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];