mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 08:45:27 +00:00
fix: a simple physics construction keeps pending changes for the update
LWOSimplePhysicsComponent::Deserialize (0x00be4b00) reads the velocity and the motion state each behind its own flag bit. DLU cleared both dirty flags when it wrote a construction, which goes only to the client the object came into range of, so the clients already watching it never got a change that was waiting for the next update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,13 +73,14 @@ void SimplePhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bool bIs
|
||||
outBitStream.Write(m_Velocity);
|
||||
outBitStream.Write(m_AngularVelocity);
|
||||
}
|
||||
if (writeVelocity || bIsInitialUpdate) m_DirtyVelocity = false;
|
||||
// A construction goes to the one client the object came into range of; the others still need the change
|
||||
if (writeVelocity && !bIsInitialUpdate) m_DirtyVelocity = false;
|
||||
|
||||
// Physics motion state
|
||||
outBitStream.Write(m_DirtyPhysicsMotionState || bIsInitialUpdate);
|
||||
if (m_DirtyPhysicsMotionState || bIsInitialUpdate) {
|
||||
outBitStream.Write<uint32_t>(m_PhysicsMotionState);
|
||||
m_DirtyPhysicsMotionState = false;
|
||||
if (!bIsInitialUpdate) m_DirtyPhysicsMotionState = false;
|
||||
}
|
||||
PhysicsComponent::Serialize(outBitStream, bIsInitialUpdate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user