fixes entry for PR #821 - engulfer vs closed door

Pull request from entrez:  don't allow an amorphous engulfer who
has swallowed the hero to move to a closed door location.  If some
hypothetical amorphous holder existed, it could move to such a spot
while holding the hero adjacent.

Closes #821
This commit is contained in:
PatR
2022-07-22 15:30:14 -07:00
parent ac0d6a98ce
commit c1e22b9e75
2 changed files with 4 additions and 1 deletions

View File

@@ -1885,8 +1885,10 @@ mfndpos(
|| dmgtype(mdat, AD_CORR)))))
continue;
if (IS_DOOR(ntyp)
/* an amorphous creature can only move under/through a
closed door if it doesn't currently have hero engulfed */
&& !((amorphous(mdat) || can_fog(mon))
&& !(u.uswallow && mon == u.ustuck))
&& (mon != u.ustuck || !u.uswallow))
&& (((levl[nx][ny].doormask & D_CLOSED) && !(flag & OPENDOOR))
|| ((levl[nx][ny].doormask & D_LOCKED)
&& !(flag & UNLOCKDOOR))) && !thrudoor)