Skip to content

Commit

Permalink
Core/Spells: Fixed crash with m_delayMoment calculation for reflected…
Browse files Browse the repository at this point in the history
… spells
  • Loading branch information
Shauren committed Mar 20, 2018
1 parent 5734788 commit 2e47bce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/game/Spells/Spell.cpp
Expand Up @@ -2182,10 +2182,6 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
targetInfo.timeDelay = uint64(std::floor(dist / m_spellInfo->Speed * 1000.0f));
else
targetInfo.timeDelay = uint64(m_spellInfo->Speed * 1000.0f);

// Calculate minimum incoming time
if (!m_delayMoment || m_delayMoment > targetInfo.timeDelay)
m_delayMoment = targetInfo.timeDelay;
}
else
targetInfo.timeDelay = 0ULL;
Expand All @@ -2205,6 +2201,10 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
else
targetInfo.reflectResult = SPELL_MISS_NONE;

// Calculate minimum incoming time
if (targetInfo.timeDelay && (!m_delayMoment || m_delayMoment > targetInfo.timeDelay))
m_delayMoment = targetInfo.timeDelay;

// Add target to list
m_UniqueTargetInfo.push_back(targetInfo);
}
Expand Down

0 comments on commit 2e47bce

Please sign in to comment.