Core/Transports: Fixed clientside position of stoppable transports

This commit is contained in:
Shauren
2025-04-17 00:04:41 +02:00
parent 821ecf8fa3
commit 96026bfc58
2 changed files with 6 additions and 4 deletions

View File

@@ -658,9 +658,11 @@ void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags, Playe
data->FlushBits();
if (transport)
{
*data << uint32(transport->GetTransportPeriod());
*data << uint32(transport->GetTimer());
data->WriteBit(transport->IsStopRequested());
uint32 period = transport->GetTransportPeriod();
*data << uint32((((int64(transport->GetTimer()) - int64(GameTime::GetGameTimeMS())) % period) + period) % period); // TimeOffset
*data << uint32(transport->GetNextStopTimestamp().value_or(0));
data->WriteBit(transport->GetNextStopTimestamp().has_value());
data->WriteBit(transport->IsStopped());
data->WriteBit(false);
data->FlushBits();

View File

@@ -89,7 +89,7 @@ class TC_GAME_API Transport final : public GameObject, public TransportBase
uint32 GetTransportPeriod() const { return m_gameObjectData->Level; }
void SetPeriod(uint32 period) { SetLevel(period); }
uint32 GetTimer() const { return _pathProgress; }
bool IsStopRequested() const { return _requestStopTimestamp.has_value(); }
Optional<uint32> GetNextStopTimestamp() const { return _requestStopTimestamp; }
bool IsStopped() const { return HasDynamicFlag(GO_DYNFLAG_LO_STOPPED); }
void UpdatePosition(float x, float y, float z, float o);