Core/Spell: Fixed bug where spell could fail to hit a target properly even if all conditions were met (#18596)

This commit is contained in:
xinef1 authored and Aokromes committed 2017-01-01 13:29:19 +01:00
1 parent 9a4e27b203
commit 2f43df388d
1 file changed
+5 -1
+5 -1
View File
@@ -3069,7 +3069,11 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
TriggerGlobalCooldown();
//item: first cast may destroy item and second cast causes crash
if (!m_casttime && !m_spellInfo->StartRecoveryTime && !m_castItemGUID && GetCurrentContainer() == CURRENT_GENERIC_SPELL)
// commented out !m_spellInfo->StartRecoveryTime, it forces instant spells with global cooldown to be processed in spell::update
// as a result a spell that passed CheckCast and should be processed instantly may suffer from this delayed process
// the easiest bug to observe is LoS check in AddUnitTarget, even if spell passed the CheckCast LoS check the situation can change in spell::update
// because target could be relocated in the meantime, making the spell fly to the air (no targets can be registered, so no effects processed, nothing in combat log)
if (!m_casttime && /*!m_spellInfo->StartRecoveryTime && */!m_castItemGUID && GetCurrentContainer() == CURRENT_GENERIC_SPELL)
cast(true);
}
}