mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 11:43:18 -04:00
3.3.5 gameobject summoner (#23289)
* Scripts/Misc: Change IsSummonedBy(Unit*) to IsSummonedBy(WorldObject*) * Scripts/Misc: Fix build * Core/TempSummons: Rename GetSummoner() to GetSummonerUnit() * Core/TempSummons: Add support to TempSummons::GetSummoner() to return GameObject too * Fix build * Core/TempSummons: Allow GameObject to be owner of TempSummon * Core/TempSummons: Add support to SAI for GameObject owner of TempSummon * Scripts/Misc: Fix no-pch build * Core/TempSummons: Implement PR comments
This commit is contained in:
@@ -2708,13 +2708,13 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
|
||||
if (!charmerOrOwnerGuid)
|
||||
if (TempSummon* tempSummon = me->ToTempSummon())
|
||||
if (Unit* summoner = tempSummon->GetSummoner())
|
||||
if (WorldObject* summoner = tempSummon->GetSummoner())
|
||||
charmerOrOwnerGuid = summoner->GetGUID();
|
||||
|
||||
if (!charmerOrOwnerGuid)
|
||||
charmerOrOwnerGuid = me->GetCreatorGUID();
|
||||
|
||||
if (Unit* owner = ObjectAccessor::GetUnit(*me, charmerOrOwnerGuid))
|
||||
if (WorldObject* owner = ObjectAccessor::GetWorldObject(*me, charmerOrOwnerGuid))
|
||||
targets.push_back(owner);
|
||||
}
|
||||
else if (go)
|
||||
@@ -2726,7 +2726,7 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
// Get owner of owner
|
||||
if (e.target.owner.useCharmerOrOwner && !targets.empty())
|
||||
{
|
||||
Unit* owner = targets.front()->ToUnit();
|
||||
WorldObject* owner = targets.front();
|
||||
targets.clear();
|
||||
|
||||
if (Unit* base = ObjectAccessor::GetUnit(*owner, owner->GetCharmerOrOwnerGUID()))
|
||||
|
||||
Reference in New Issue
Block a user