aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellScript.cpp
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2020-07-09 20:03:40 +0200
committerGitHub <noreply@github.com>2020-07-09 20:03:40 +0200
commit94a4404e7e0667eab5d79c01444855966c41ad56 (patch)
tree0b67cef030bc724b848160dff3c2c35803270fa4 /src/server/game/Spells/SpellScript.cpp
parentf99a79cb4301f1d76d95b9c953918216947a2b94 (diff)
Core/Spells: Expose corpseTarget to spell scripts with SpellScript::GetHitCorpse() (#24981)
Closes #24945
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rw-r--r--src/server/game/Spells/SpellScript.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 23b858502b4..04e397ad8fd 100644
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -552,6 +552,16 @@ GameObject* SpellScript::GetHitGObj() const
return m_spell->gameObjTarget;
}
+Corpse* SpellScript::GetHitCorpse() const
+{
+ if (!IsInTargetHook())
+ {
+ TC_LOG_ERROR("scripts", "Script: `%s` Spell: `%u`: function SpellScript::GetHitCorpse was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ return nullptr;
+ }
+ return m_spell->corpseTarget;
+}
+
WorldLocation* SpellScript::GetHitDest() const
{
if (!IsInEffectHook())