Skip to content

Commit 72f39d5

Browse files
author
Alex Smith
committed
When failing to place a migrating monster, ignore water/land issues
Emergency push as this is affecting a current Junethack game.
1 parent 1ab90b6 commit 72f39d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libnethack/src/mon.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* vim:set cin ft=c sw=4 sts=4 ts=8 et ai cino=Ls\:0t0(0 : -*- mode:c;fill-column:80;tab-width:8;c-basic-offset:4;indent-tabs-mode:nil;c-file-style:"k&r" -*-*/
2-
/* Last modified by Alex Smith, 2015-10-11 */
2+
/* Last modified by Alex Smith, 2016-06-30 */
33
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
44
/* NetHack may be freely redistributed. See license for details. */
55

@@ -2219,8 +2219,10 @@ mnearto(struct monst * mtmp, xchar x, xchar y, boolean move_other)
22192219
/* actually we have real problems if enexto ever fails. migrating_mons
22202220
that need to be placed will cause no end of trouble. */
22212221
if (!enexto(&mm, level, newx, newy, mtmp->data))
2222-
panic("Nowhere to place '%s' (at (%d, %d), wanted (%d, %d))",
2223-
k_monnam(mtmp), mtmp->mx, mtmp->my, x, y);
2222+
if (!enexto_core(&mm, level, newx, newy, mtmp->data,
2223+
MM_IGNOREWATER))
2224+
panic("Nowhere to place '%s' (at (%d, %d), wanted (%d, %d))",
2225+
k_monnam(mtmp), mtmp->mx, mtmp->my, x, y);
22242226
newx = mm.x;
22252227
newy = mm.y;
22262228
}

0 commit comments

Comments
 (0)