From 6730879069d0016584a5211ce7a75fe4cebf2712 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 4 May 2022 11:01:33 -0400 Subject: [PATCH] Core/Creatures: Add summoned creatures to summoners transport Port From (https://github.com/TrinityCore/TrinityCore/commit/20af35fd1393e24c747fdfa30760f52bd6ee04e6) --- Source/Game/Maps/Map.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index f5011f6b2..ff418bea1 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -4118,6 +4118,17 @@ namespace Game.Maps if (!summon.Create(GenerateLowGuid(HighGuid.Creature), this, entry, pos, null, vehId, true)) return null; + Transport transport = summoner != null ? summoner.GetTransport() : null; + if (transport) + { + pos.GetPosition(out float x, out float y, out float z, out float o); + transport.CalculatePassengerOffset(ref x, ref y, ref z, ref o); + summon.m_movementInfo.transport.pos.Relocate(x, y, z, o); + + // This object must be added to transport before adding to map for the client to properly display it + transport.AddPassenger(summon); + } + // Set the summon to the summoner's phase if (summoner != null && !(properties != null && properties.GetFlags().HasFlag(SummonPropertiesFlags.IgnoreSummonerPhase))) PhasingHandler.InheritPhaseShift(summon, summoner); @@ -4143,6 +4154,10 @@ namespace Game.Maps if (!AddToMap(summon.ToCreature())) { + // Returning false will cause the object to be deleted - remove from transport + if (transport) + transport.RemovePassenger(summon); + summon.Dispose(); return null; }