Core/Objects: Use player as summoner for personal clones

Port From (https://github.com/TrinityCore/TrinityCore/commit/79c605436942d652c50e4cfeac9d1b20a86a2343)
This commit is contained in:
hondacrx
2022-05-05 10:02:40 -04:00
parent fcdcb69fe5
commit 39ec9e309f
3 changed files with 29 additions and 17 deletions
+2 -3
View File
@@ -2483,13 +2483,12 @@ namespace Game.AI
{
WorldObject baseObject = GetBaseObject();
void doCreatePersonalClone(Position position, Unit owner)
void doCreatePersonalClone(Position position, Player privateObjectOwner)
{
ObjectGuid privateObjectOwner = owner.GetGUID();
Creature summon = GetBaseObject().SummonPersonalClone(position, (TempSummonType)e.Action.becomePersonalClone.type, TimeSpan.FromMilliseconds(e.Action.becomePersonalClone.duration), 0, 0, privateObjectOwner);
if (summon != null)
if (IsSmart(summon))
((SmartAI)summon.GetAI()).SetTimedActionList(e, (uint)e.EntryOrGuid, owner, e.EventId + 1);
((SmartAI)summon.GetAI()).SetTimedActionList(e, (uint)e.EntryOrGuid, privateObjectOwner, e.EventId + 1);
}
// if target is position then targets container was empty