fix out-of-bounds not in test_move()

Commit 0381e61624 fixed a problem
for mon vs hero in test_move(), but the situation can also happen
with mon vs mon which doesn't use test_move().
This commit is contained in:
PatR
2024-12-17 13:46:25 -08:00
parent 80a0a309ea
commit 6e587fb282

View File

@@ -5160,6 +5160,8 @@ mhitm_knockback(
return FALSE;
} else {
/* subset of test_move() */
if (!isok(defx + dx, defy + dy))
return FALSE;
if (IS_DOOR(levl[defx][defy].typ)
&& (defx - magr->mx && defy - magr->my)
&& !doorless_door(defx, defy))