Core/Spells: rework part 5: GameObject casting

This commit is contained in:
ariel- authored and Ovahlord committed 2022-09-12 09:15:14 +02:00
1 parent c901772640
commit b6fac86b71
43 files changed
+2638 -2337

No files matched your search

+17 -3
View File
@@ -186,12 +186,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
@@ -642,7 +647,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