fix #K4331 - sticking from distance

Stop attacking if target isn't there anymore.  Already handled for
two-weapon in normal form, not for multi-attacks in poly'd form and
for multi-attack monster vs hero or monster vs other monster.

I didn't attempt to reproduce the reported problem.  This fix is
based on code inspection.

Also prevent monsters that have hug or engulf attacks from knocking
target back with other attacks since that prohibits the grab/engulf
from being able to hit.
This commit is contained in:
PatR
2025-06-03 22:13:22 -07:00
parent 28af1d6410
commit 45f751989a
3 changed files with 35 additions and 10 deletions

View File

@@ -754,6 +754,8 @@ mattacku(struct monst *mtmp)
/* if hero was found but isn't anymore, avoid wildmiss now */
if (firstfoundyou && !foundyou)
continue; /* set sum[i] to 'miss' but skip other actions */
if (!u_at(gb.bhitpos.x, gb.bhitpos.y))
continue;
}
mon_currwep = (struct obj *) 0;
mattk = getmattk(mtmp, &gy.youmonst, i, sum, &alt_attk);