Core/Spells: rework part 5: GameObject casting

Closes #21330
Closes #18885
Ref #18752

(cherry picked from commit 45c5e1b9d6)
This commit is contained in:
ariel-
2018-02-10 16:43:01 -03:00
committed by Shauren
parent 65dca120d3
commit 962f6d7988
46 changed files with 2775 additions and 2419 deletions

View File

@@ -467,12 +467,17 @@ bool SpellScript::IsInEffectHook() const
Unit* SpellScript::GetCaster() const
{
return m_spell->GetCaster();
return m_spell->GetCaster()->ToUnit();
}
GameObject* SpellScript::GetGObjCaster() const
{
return m_spell->GetCaster()->ToGameObject();
}
Unit* SpellScript::GetOriginalCaster() const
{
return m_spell->GetOriginalCaster();
return m_spell->GetOriginalCaster();
}
SpellInfo const* SpellScript::GetSpellInfo() const
@@ -1161,7 +1166,16 @@ ObjectGuid AuraScript::GetCasterGUID() const
Unit* AuraScript::GetCaster() const
{
return m_aura->GetCaster();
if (WorldObject* caster = m_aura->GetCaster())
return caster->ToUnit();
return nullptr;
}
GameObject* AuraScript::GetGObjCaster() const
{
if (WorldObject* caster = m_aura->GetCaster())
return caster->ToGameObject();
return nullptr;
}
WorldObject* AuraScript::GetOwner() const