mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752
(cherry picked from commit 45c5e1b9d6)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user