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:
Aaron Kimbrell
2026-11-10 13:09:43 -06:00
parent f4d3d794fd
commit a269ce0cc7
2 changed files with 32 additions and 2 deletions

View File

@@ -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);
}