From 429fac7cb695b9e62c36a87e4115e6cb06894ae5 Mon Sep 17 00:00:00 2001 From: xinef1 Date: Fri, 30 Dec 2016 17:41:47 +0100 Subject: Core/Spell: Fixed bug where spell could fail to hit a target properly even if all conditions were met (#18596) (cherry picked from commit 464d3ad5d09d58136911f4ad09335f53049ac628) --- src/server/game/Spells/Spell.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 587bb40e50f..104d1901a7f 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3138,7 +3138,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); } } -- cgit v1.2.3