From 8eeab8a93e499286dd8df91f1e3ae8decbea7133 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 14 Oct 2020 04:00:48 +0200 Subject: [PATCH] Fix OOB in monster_posok --- Source/monster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 0f1264f22..e7fc63fde 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -5742,9 +5742,9 @@ BOOLEAN monster_posok(int i, int x, int y) fire = FALSE; lightning = FALSE; if (mi > 0) { - if (missile[mi]._mitype == MIS_FIREWALL) { // BUGFIX: Change 'mi' to 'mi - 1' + if (missile[mi - 1]._mitype == MIS_FIREWALL) { // BUGFIX: Change 'mi' to 'mi - 1' (fixed) fire = TRUE; - } else if (missile[mi]._mitype == MIS_LIGHTWALL) { // BUGFIX: Change 'mi' to 'mi - 1' + } else if (missile[mi - 1]._mitype == MIS_LIGHTWALL) { // BUGFIX: Change 'mi' to 'mi - 1' (fixed) lightning = TRUE; } } else {