diff options
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rw-r--r-- | src/server/game/Spells/SpellScript.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 577273d4ff7..04327bf59c1 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -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 |