Core/Spells: Fixed crash with m_delayMoment calculation for reflected spells

This commit is contained in:
hondacrx
2018-03-21 23:40:27 -04:00
parent 193f138600
commit af0f142f36
+4 -4
View File
@@ -1675,10 +1675,6 @@ namespace Game.Spells
targetInfo.timeDelay = (ulong)Math.Floor((dist / m_spellInfo.Speed) * 1000.0f);
else
targetInfo.timeDelay = (ulong)(m_spellInfo.Speed * 1000.0f);
// Calculate minimum incoming time
if (m_delayMoment == 0 || m_delayMoment > targetInfo.timeDelay)
m_delayMoment = targetInfo.timeDelay;
}
else
targetInfo.timeDelay = 0L;
@@ -1698,6 +1694,10 @@ namespace Game.Spells
else
targetInfo.reflectResult = SpellMissInfo.None;
// Calculate minimum incoming time
if (targetInfo.timeDelay != 0 && (m_delayMoment == 0 || m_delayMoment > targetInfo.timeDelay))
m_delayMoment = targetInfo.timeDelay;
// Add target to list
m_UniqueTargetInfo.Add(targetInfo);
}