Define engulfing_u, making clearer code

This commit is contained in:
Pasi Kallinen
2021-12-31 21:12:12 +02:00
parent 776064933a
commit 8db18275a6
16 changed files with 37 additions and 36 deletions

View File

@@ -1136,7 +1136,7 @@ m_move(register struct monst* mtmp, register int after)
gx = mtmp->mux;
gy = mtmp->muy;
appr = mtmp->mflee ? -1 : 1;
if (mtmp->mconf || (u.uswallow && mtmp == u.ustuck)) {
if (mtmp->mconf || engulfing_u(mtmp)) {
appr = 0;
} else {
boolean should_see = (couldsee(omx, omy)
@@ -1617,7 +1617,7 @@ m_move(register struct monst* mtmp, register int after)
return 2; /* mon died (position already updated) */
/* set also in domove(), hack.c */
if (u.uswallow && mtmp == u.ustuck
if (engulfing_u(mtmp)
&& (mtmp->mx != omx || mtmp->my != omy)) {
/* If the monster moved, then update */
u.ux0 = u.ux;