Core/Spells: Fixed crash in spells with charge effects that also apply another effect on the caster

Closes #28983
This commit is contained in:
Shauren
2023-07-01 00:51:15 +02:00
parent 083ef35acc
commit 263d1f4fe5
+1 -1
View File
@@ -884,7 +884,7 @@ void Spell::UpdateDelayMomentForUnitTarget(Unit* unit, uint64 hitDelay)
// if new hit delay is greater than old delay for this target we must check all other spell targets to see if m_delayMoment can be increased
auto minDelayTargetItr = std::min_element(m_UniqueTargetInfo.begin(), m_UniqueTargetInfo.end(), [](Spell::TargetInfo const& itr, Spell::TargetInfo const& smallest)
{
return itr.TimeDelay < smallest.TimeDelay;
return itr.TimeDelay && itr.TimeDelay < smallest.TimeDelay;
});
m_delayMoment = minDelayTargetItr->TimeDelay;