Core/Creatures: Update creature transport offsets when teleporting while on transport

Port From (https://github.com/TrinityCore/TrinityCore/commit/f205e50f929955e9daafb6d85d8c1f57d9c0dbdc)
This commit is contained in:
hondacrx
2022-10-31 13:57:54 -04:00
parent 1f774369f2
commit 7ff79d0eda
@@ -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.