From b0a494ebb35bf5f81cfca518fbdfc61f5121da9d 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 fbe2481a9..e5fa51df4 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -247,7 +247,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); }