aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authorthenecromancer <none@none>2010-03-11 20:51:31 +0100
committerthenecromancer <none@none>2010-03-11 20:51:31 +0100
commite1542df90ccde91e2f7fded2d5378d77b1f9ea84 (patch)
treea2d4cfaa4ede97263b30ce11c8ff1450361de846 /src/game/Spell.cpp
parent02a9cd6a43a18f2350801bd9473c2346b36b0575 (diff)
Convert some C style casts to new functions
--HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 7f2b0a76017..85c9c17e07c 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1182,7 +1182,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell);
if(caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET) == 0 &&
(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED))
- ((Player *)caster)->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx);
+ caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx);
}
caster->DealSpellDamage(&damageInfo, true);
@@ -1730,7 +1730,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
if ((*itr)->GetEntry() == i_spellST->second.targetEntry && (*itr)->IsWithinDistInMap(m_caster, range))
{
goScriptTarget = NULL;
- creatureScriptTarget = ((Creature *)*itr);
+ creatureScriptTarget = (*itr)->ToCreature();
range = m_caster->GetDistance(creatureScriptTarget);
}
break;
@@ -4506,7 +4506,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
m_spellInfo->EffectImplicitTargetA[1] == TARGET_UNIT_TARGET_ENEMY)
{
- if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
+ if (target = m_caster->GetUnit(*m_caster, m_caster->ToPlayer()->GetSelection()))
m_targets.setUnitTarget(target);
else
return SPELL_FAILED_BAD_TARGETS;