From: Pasi Kallinen Date: Sat, 31 Dec 2016 22:21:53 +0000 (+0200) Subject: Fix mnearto return value confusion X-Git-Tag: NetHack-3.6.1_RC01~536 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=131ab0a20ea44777ef09595fab55397353b90fd4;p=nethack Fix mnearto return value confusion This caused appeased shopkeepers returning to their shops being killed. --- diff --git a/src/mon.c b/src/mon.c index 23ebcdb45..dbfbd5a40 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2518,8 +2518,8 @@ struct monst *mtmp; /* mnearto() * Put monster near (or at) location if possible. * Returns: - * 1 - if a monster was moved from x, y to put mtmp at x, y. - * 0 - in most cases. + * true if relocation was successful + * false otherwise */ boolean mnearto(mtmp, x, y, move_other) @@ -2532,7 +2532,7 @@ boolean move_other; /* make sure mtmp gets to x, y! so move m_at(x, y) */ coord mm; if (mtmp->mx == x && mtmp->my == y) - return FALSE; + return TRUE; if (move_other && (othermon = m_at(x, y)) != 0) { if (othermon->wormno) @@ -2570,7 +2570,7 @@ boolean move_other; /* make sure mtmp gets to x, y! so move m_at(x, y) */ } } - return FALSE; + return TRUE; } /* monster responds to player action; not the same as a passive attack;