aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSnapperRy <snapperryen@gmail.com>2016-08-24 00:13:26 +0200
committerTreeston <treeston.mmoc@gmail.com>2016-08-24 00:13:26 +0200
commit1fcd03b60a17db5fddef13feb6fe6b8d7178d0f5 (patch)
tree0361a427881f8da8df7363c65d679e25df662d0e
parent753f047295ec3088702d501569fe552bf006376e (diff)
Core/SmartAI: allow SMART_TARGET_OWNER_OR_SUMMONER to target a temporary summon's summoner, too (#17851)
Core/SmartAI: allow SMART_TARGET_OWNER_OR_SUMMONER to target a temporary summon's summoner, too
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 0e74ca6236e..be26b9f9ca5 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2758,6 +2758,11 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
ObjectGuid charmerOrOwnerGuid = me->GetCharmerOrOwnerGUID();
if (!charmerOrOwnerGuid)
+ if (TempSummon* tempSummon = me->ToTempSummon())
+ if (Unit* summoner = tempSummon->GetSummoner())
+ charmerOrOwnerGuid = summoner->GetGUID();
+
+ if (!charmerOrOwnerGuid)
charmerOrOwnerGuid = me->GetCreatorGUID();
if (Unit* owner = ObjectAccessor::GetUnit(*me, charmerOrOwnerGuid))