From 3fd926d5442413e5945b77f4d3f7d6432f3a820f Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 20 Nov 2021 19:34:25 +0100 Subject: [PATCH] BUGFIX: check for dObject OOB --- Source/items.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index 314b3fb25..052465fe6 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -1588,14 +1588,14 @@ BOOL ItemSpaceOk(int i, int j) return FALSE; } - if (dObject[i + 1][j + 1] > 0 && object[dObject[i + 1][j + 1] - 1]._oSelFlag != 0) + if (dObject[i + 1][j + 1] > 0 && object[dObject[i + 1][j + 1] - 1]._oSelFlag != 0) /// BUGFIX: check for dObject OOB return FALSE; - if (dObject[i + 1][j + 1] < 0 && object[-(dObject[i + 1][j + 1] + 1)]._oSelFlag != 0) + if (dObject[i + 1][j + 1] < 0 && object[-(dObject[i + 1][j + 1] + 1)]._oSelFlag != 0) /// BUGFIX: check for dObject OOB return FALSE; - if (dObject[i + 1][j] > 0 - && dObject[i][j + 1] > 0 + if (dObject[i + 1][j] > 0 /// BUGFIX: check for dObject OOB + && dObject[i][j + 1] > 0 /// BUGFIX: check for dObject OOB && object[dObject[i + 1][j] - 1]._oSelFlag != 0 && object[dObject[i][j + 1] - 1]._oSelFlag != 0) { return FALSE;