From f27087d61b0f2e22dbbcd998f1917ec4bd9d609a Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Sun, 10 Aug 2025 17:08:30 -0400 Subject: [PATCH] Core/Transports: Fixed clientside position of stoppable transports Port From (https://github.com/TrinityCore/TrinityCore/commit/96026bfc58faa65aeef5cb1430aa2e442a43b115) --- Source/Game/Entities/Object/WorldObject.cs | 8 +++++--- Source/Game/Entities/Transport.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 7946a30c7..dc84c0331 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -649,9 +649,11 @@ namespace Game.Entities data.FlushBits(); if (transport != null) { - data.WriteUInt32(transport.GetTransportPeriod()); - data.WriteUInt32(transport.GetTimer()); - data.WriteBit(transport.IsStopRequested()); + uint period = transport.GetTransportPeriod(); + + data.WriteUInt32((uint)((((long)transport.GetTimer() - (long)GameTime.GetGameTimeMS()) % period) + period) % period); // TimeOffset + data.WriteUInt32(transport.GetNextStopTimestamp().GetValueOrDefault(0)); + data.WriteBit(transport.GetNextStopTimestamp().HasValue); data.WriteBit(transport.IsStopped()); data.WriteBit(false); data.FlushBits(); diff --git a/Source/Game/Entities/Transport.cs b/Source/Game/Entities/Transport.cs index 5239905df..b219cdd92 100644 --- a/Source/Game/Entities/Transport.cs +++ b/Source/Game/Entities/Transport.cs @@ -766,7 +766,7 @@ namespace Game.Entities public uint GetTransportPeriod() { return m_gameObjectData.Level; } public void SetPeriod(uint period) { SetLevel(period); } public uint GetTimer() { return _pathProgress; } - public bool IsStopRequested() { return _requestStopTimestamp.HasValue; } + public uint? GetNextStopTimestamp() { return _requestStopTimestamp; } public bool IsStopped() { return HasDynamicFlag(GameObjectDynamicLowFlags.Stopped);