From b363d5d962bf0f03989e0cef1f3d7d92882d3a8c Mon Sep 17 00:00:00 2001 From: staphen Date: Tue, 14 Jun 2022 14:59:13 -0400 Subject: [PATCH] Fix order of loop conditions when adding spell missiles --- Source/spells.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/spells.cpp b/Source/spells.cpp index 2b650934e..a7fced951 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -240,7 +240,7 @@ void CastSpell(int id, spell_id spl, int sx, int sy, int dx, int dy, int spllvl) dir = Players[id].tempDirection; } - for (int i = 0; spelldata[spl].sMissiles[i] != MIS_NULL && i < 3; i++) { + for (int i = 0; i < 3 && spelldata[spl].sMissiles[i] != MIS_NULL; i++) { AddMissile({ sx, sy }, { dx, dy }, dir, spelldata[spl].sMissiles[i], TARGET_MONSTERS, id, 0, spllvl); }