Browse Source

Fix order of loop conditions when adding spell missiles

pull/5058/head
staphen 4 years ago committed by Anders Jenbo
parent
commit
b0a494ebb3
  1. 2
      Source/spells.cpp

2
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);
}

Loading…
Cancel
Save