From 64ea9a5ec2ba7aca0cc1cbbf04b1ea4fd6b26c2a Mon Sep 17 00:00:00 2001 From: Robin Eklind Date: Sun, 25 Apr 2021 18:30:16 +0200 Subject: [PATCH] missiles: add BUGFIX for MI_Apoca when handling golems Prior to this fix, the apocalypse spell would hit the golem of the 4th player (i.e. plr[3]), since dMonster stores monster number + 1. --- Source/missiles.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 8afd5d473..0a259b662 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -5413,6 +5413,7 @@ void MI_Apoca(int i) exit = FALSE; for (j = missile[i]._miVar2; j < missile[i]._miVar3 && !exit; j++) { for (k = missile[i]._miVar4; k < missile[i]._miVar5 && !exit; k++) { + // BUGFIX: was `dMonster[k][j] > MAX_PLRS-1`, should be `dMonster[k][j]-1 >= MAX_PLRS`. if (dMonster[k][j] > MAX_PLRS - 1 && !nSolidTable[dPiece[k][j]]) { #ifdef HELLFIRE if (LineClear(missile[i]._mix, missile[i]._miy, k, j)) {