aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp12
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)