Core/Objects: Pass privateObjectOwner guid directly to SummonCreature functions

Port From (https://github.com/TrinityCore/TrinityCore/commit/33b3ebcae67870f704d86d30aa357781b33bb411)
This commit is contained in:
hondacrx
2021-03-29 17:31:48 -04:00
parent 1ca5b5bcad
commit 98f9fdaf53
4 changed files with 18 additions and 16 deletions
+2 -4
View File
@@ -3913,7 +3913,7 @@ namespace Game.Maps
}
}
public TempSummon SummonCreature(uint entry, Position pos, SummonPropertiesRecord properties = null, uint duration = 0, Unit summoner = null, uint spellId = 0, uint vehId = 0, bool personalSpawn = false)
public TempSummon SummonCreature(uint entry, Position pos, SummonPropertiesRecord properties = null, uint duration = 0, Unit summoner = null, uint spellId = 0, uint vehId = 0, ObjectGuid privateObjectOwner = default)
{
var mask = UnitTypeMask.Summon;
if (properties != null)
@@ -3995,9 +3995,7 @@ namespace Game.Maps
summon.SetCreatedBySpell(spellId);
summon.SetHomePosition(pos);
summon.InitStats(duration);
if (personalSpawn && summoner != null)
summon.SetPrivateObjectOwner(summoner.IsPrivateObject() ? summoner.GetPrivateObjectOwner() : summoner.GetGUID());
summon.SetPrivateObjectOwner(privateObjectOwner);
AddToMap(summon.ToCreature());
summon.InitSummon();