From 6e587fb282c81de66c818ea2cd92be5233754cc5 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 17 Dec 2024 13:46:25 -0800 Subject: [PATCH] fix out-of-bounds not in test_move() Commit 0381e6162459fe01038fbcdf279a1418796a4113 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(). --- src/uhitm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/uhitm.c b/src/uhitm.c index b77c018e3..64eb46e3e 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -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))