Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-11-22 23:37:48 -05:00
2 changed files with 20 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 monmove.c $NHDT-Date: 1557094802 2019/05/05 22:20:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.113 $ */
/* NetHack 3.6 monmove.c $NHDT-Date: 1574475416 2019/11/23 02:16:56 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.114 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1653,8 +1653,8 @@ register struct monst *mtmp;
*/
boolean
undesirable_disp(mtmp, x, y)
struct monst *mtmp;
xchar x, y;
struct monst *mtmp; /* barging creature */
xchar x, y; /* spot 'mtmp' is considering moving to */
{
boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion);
struct trap *trap = t_at(x, y);
@@ -1673,6 +1673,17 @@ xchar x, y;
return TRUE;
}
/* oversimplification: creatures that bargethrough can't do so when
target monster is in rock or closed door or water (in particular,
avoid moving to spots where mondied() won't leave a corpse) */
if (!accessible(x, y)
/* mondied() allows ispool() as an exception to !accessible(),
but we'll only do that if both or neither of mtmp's spot and
destination spot are water so that we don't swap a water
critter onto land or the inverse */
&& (!is_pool(x, y) ^ !is_pool(mtmp->mx, mtmp->my)))
return TRUE;
return FALSE;
}