From 1ba55bd9d2d3ddf73d2bff6229c92a7624f6a5f9 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 18 Mar 2018 12:13:49 -0400 Subject: [PATCH] Core/Spell: Fixed bug where spell could fail to hit a target properly even if all conditions were met --- Source/Game/Spells/Spell.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 68bdd05c5..7a2e48981 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -2651,7 +2651,11 @@ namespace Game.Spells TriggerGlobalCooldown(); //item: first cast may destroy item and second cast causes crash - if (m_casttime == 0 && m_spellInfo.StartRecoveryTime == 0 && m_castItemGUID.IsEmpty() && GetCurrentContainer() == CurrentSpellTypes.Generic) + // 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 == 0 && /*m_spellInfo.StartRecoveryTime == 0 && */ m_castItemGUID.IsEmpty() && GetCurrentContainer() == CurrentSpellTypes.Generic) cast(true); } }