diff options
author | megamage <none@none> | 2009-01-30 19:00:09 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-30 19:00:09 -0600 |
commit | 9b927d17426caab8b92f5329e9879200cd1d5468 (patch) | |
tree | e40cd4a2f553c29811a9b26c5057c4a187e15a39 /src/game/SpellEffects.cpp | |
parent | 8fee06f041fbfbc7e22eccc03a8f12bd7a649999 (diff) |
*Fix charge spells: do stun effect when caster arrive target.
*Some other fix about delayed spell calculation.
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r-- | src/game/SpellEffects.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 2141c95a21b..047637e00f8 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -159,7 +159,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectUnused, // 93 SPELL_EFFECT_SUMMON_PHANTASM &Spell::EffectSelfResurrect, // 94 SPELL_EFFECT_SELF_RESURRECT &Spell::EffectSkinning, // 95 SPELL_EFFECT_SKINNING - &Spell::EffectCharge, // 96 SPELL_EFFECT_CHARGE + &Spell::EffectUnused, // 96 SPELL_EFFECT_CHARGE &Spell::EffectSummonCritter, // 97 SPELL_EFFECT_SUMMON_CRITTER &Spell::EffectKnockBack, // 98 SPELL_EFFECT_KNOCK_BACK &Spell::EffectDisEnchant, // 99 SPELL_EFFECT_DISENCHANT @@ -5734,16 +5734,20 @@ void Spell::EffectSkinning(uint32 /*i*/) void Spell::EffectCharge(uint32 /*i*/) { - if(!unitTarget || !m_caster) + if(!m_caster) + return; + + Unit *target = m_targets.getUnitTarget(); + if(!target) return; float x, y, z; - unitTarget->GetContactPoint(m_caster, x, y, z); + target->GetContactPoint(m_caster, x, y, z); m_caster->GetMotionMaster()->MoveCharge(x, y, z); // not all charge effects used in negative spells if ( !IsPositiveSpell(m_spellInfo->Id) && m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->Attack(unitTarget,true); + m_caster->Attack(target, true); } void Spell::EffectSummonCritter(uint32 i) |