From: Pasi Kallinen Date: Tue, 7 Apr 2020 14:23:18 +0000 (+0300) Subject: Fix monster booted into limbo trying to act X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=297eb934a76338ee71c82faa1449d6e81878c821;p=nethack Fix monster booted into limbo trying to act There's a chance that a tactics-using monster (eg. arch-lich) teleporting next to you on a full level would get booted off into limbo. After that, if the monster tried using an item in the same action you'd get panic "relmon: mon not in list" Fix this particular case by checking monster mstate. Other cases may lurk in other places that eventually call mnexto. --- diff --git a/src/monmove.c b/src/monmove.c index 65433ed71..26e848c8e 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -503,8 +503,12 @@ register struct monst *mtmp; /* Monsters that want to acquire things */ /* may teleport, so do it before inrange is set */ - if (is_covetous(mdat)) + if (is_covetous(mdat)) { (void) tactics(mtmp); + /* tactics -> mnexto -> deal_with_overcrowding */ + if (mtmp->mstate) + return 0; + } /* check distance and scariness of attacks */ distfleeck(mtmp, &inrange, &nearby, &scared);