diff options
author | ariel- <ariel-@users.noreply.github.com> | 2018-02-10 16:43:01 -0300 |
---|---|---|
committer | Ariel Silva <ariel-@users.noreply.github.com> | 2018-03-09 14:41:28 -0300 |
commit | 45c5e1b9d63796d168339a44f63418f220cf2403 (patch) | |
tree | c5c2ef9917147e38779d1f94e6ffc38386b9b251 /src/server/game/Spells/SpellScript.cpp | |
parent | 080d2c6cd439acb2059adc4e24a279de98aa0db6 (diff) |
Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752
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 a7f852eb884..c923a3c06c6 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -425,12 +425,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 @@ -1046,7 +1051,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 |