diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index e0a6f4fb8..c980f4f70 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3834,19 +3834,20 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e, { targets.clear(); - if (owner->ToCreature()) + if (IsCreature(owner)) { if (Unit* base = ObjectAccessor::GetUnit(*owner, owner->ToCreature()->GetCharmerOrOwnerGUID())) - { targets.push_back(base); - } } - else + else if (IsGameObject(owner)) { if (Unit* base = ObjectAccessor::GetUnit(*owner, owner->ToGameObject()->GetOwnerGUID())) - { targets.push_back(base); - } + } + else if (IsPlayer(owner)) + { + if (Unit* base = owner->ToPlayer()->GetCharmerOrOwner()) + targets.push_back(base); } } }