Core/Spells: Fix SPELL_EFFECT_SEND_EVENT handler being executed more than once when targets != (0, 0). Closes #3934

This commit is contained in:
Machiavelli
2011-11-16 19:09:51 +01:00
parent 6cd78a520a
commit c67af87eda
+10
View File
@@ -2141,6 +2141,16 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex)
&& effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
//! it's possible for spells with this spell effect to either have a target or no target
//! in case of a target, we will execute this handler on SPELL_EFFECT_HANDLE_HIT_TARGET
//! with all relevant variables, and we will skip SPELL_EFFECT_HANDLE_HIT
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT)
{
if (GetSpellInfo()->Effects[effIndex].TargetA.GetTarget() != 0 ||
GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() != 0)
return;
}
WorldObject* target = NULL;
// call events for target if present