diff options
author | megamage <none@none> | 2008-12-12 21:37:42 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-12 21:37:42 -0600 |
commit | f088698922e1bc34ef0332dae5a4768f45115d3d (patch) | |
tree | b545d2b66b00da8e8c128a40f911893850186dc8 /src/game/Spell.cpp | |
parent | 55d9e4c01d342e40db58481f89d58ec5c3940685 (diff) |
*Fix the bug that grounding totem cause client crash.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r-- | src/game/Spell.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 96cf260adc5..c253c6a30b3 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -783,6 +783,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex) target.targetGUID = targetGUID; // Store target GUID target.effectMask = 1<<effIndex; // Store index of effect target.processed = false; // Effects not apply on target + target.killTarget = false; // Calculate hit result if(m_originalCaster) @@ -1007,6 +1008,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if (!unit) return; + if(target->killTarget) + { + // remove spell_magnet aura after first spell redirect and destroy target if its totem + if(unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->isTotem()) + unit->Kill(unit); + } + // Get original caster (if exist) and calculate damage/healing from him data Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster; @@ -1036,12 +1044,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if (target->reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him DoSpellHitOnUnit(m_caster, mask); } - else if (missInfo == SPELL_MISS_KILL) - { - // remove spell_magnet aura after first spell redirect and destroy target if its totem - if(unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->isTotem()) - unit->Kill(unit); - } else //TODO: This is a hack. need fix { uint32 tempMask = 0; @@ -5382,7 +5384,7 @@ Unit* Spell::SelectMagnetTarget() { if (targetGUID == ihit->targetGUID) // Found in list { - (*ihit).missCondition = SPELL_MISS_KILL; + (*ihit).killTarget = true; break; } } |