From 2fa61ea7eef7d767125f6e352d05ffb57f8964e8 Mon Sep 17 00:00:00 2001 From: cohrs Date: Mon, 14 Oct 2002 16:08:07 +0000 Subject: [PATCH] B12002 - displacing pets thru narrow openings Add another check to domove to detect an attempt to displace a pet through a narrow opening. --- doc/fixes34.1 | 1 + src/hack.c | 7 +++++++ 2 files changed, 8 insertions(+) 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];