aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellScript.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-02-10 16:43:01 -0300
committerAriel Silva <ariel-@users.noreply.github.com>2018-03-09 14:41:28 -0300
commit45c5e1b9d63796d168339a44f63418f220cf2403 (patch)
treec5c2ef9917147e38779d1f94e6ffc38386b9b251 /src/server/game/Spells/SpellScript.cpp
parent080d2c6cd439acb2059adc4e24a279de98aa0db6 (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.cpp20
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