From 7ff79d0eda3a3ca79cbfa86fb7f5d4e5bb81fe8a Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 31 Oct 2022 13:57:54 -0400 Subject: [PATCH] Core/Creatures: Update creature transport offsets when teleporting while on transport Port From (https://github.com/TrinityCore/TrinityCore/commit/f205e50f929955e9daafb6d85d8c1f57d9c0dbdc) --- Source/Game/Entities/Unit/Unit.Movement.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index 2d39b57e2..fefef0862 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -1883,6 +1883,13 @@ namespace Game.Entities moveUpdateTeleport.Status.Guid = GetGUID(); moveUpdateTeleport.Status.Pos.Relocate(pos); moveUpdateTeleport.Status.Time = Time.GetMSTime(); + var transportBase = GetDirectTransport(); + if (transportBase != null) + { + pos.GetPosition(out float tx, out float ty, out float tz, out float to); + transportBase.CalculatePassengerOffset(ref tx, ref ty, ref tz, ref to); + moveUpdateTeleport.Status.transport.pos.Relocate(tx, ty, tz, to); + } } // Broadcast the packet to everyone except self.