mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/SAI: Make SMART_TARGET_OWNER_OR_SUMMONER also work for creatures summoned by spells
This commit is contained in:
@@ -2509,8 +2509,15 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
case SMART_TARGET_OWNER_OR_SUMMONER:
|
||||
{
|
||||
if (me)
|
||||
if (Unit* owner = ObjectAccessor::GetUnit(*me, me->GetCharmerOrOwnerGUID()))
|
||||
{
|
||||
uint64 charmerOrOwnerGuid = me->GetCharmerOrOwnerGUID();
|
||||
|
||||
if (!charmerOrOwnerGuid)
|
||||
charmerOrOwnerGuid = me->GetCreatorGUID();
|
||||
|
||||
if (Unit* owner = ObjectAccessor::GetUnit(*me, charmerOrOwnerGuid))
|
||||
l->push_back(owner);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_THREAT_LIST:
|
||||
|
||||
Reference in New Issue
Block a user