mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-24 14:33:34 +00:00
fix frame stats in vehicle racing
This commit is contained in:
parent
a9fd7c5e08
commit
e3ae0b6304
@ -89,22 +89,21 @@ void VehiclePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bI
|
||||
outBitStream->Write(m_IsOnGround);
|
||||
outBitStream->Write(m_IsOnRail);
|
||||
|
||||
outBitStream->Write(bIsInitialUpdate || m_DirtyVelocity);
|
||||
bool isVelocityZero = m_Velocity == NiPoint3::ZERO;
|
||||
|
||||
if (bIsInitialUpdate || m_DirtyVelocity) {
|
||||
outBitStream->Write(isVelocityZero);
|
||||
if (isVelocityZero) {
|
||||
outBitStream->Write(m_Velocity.x);
|
||||
outBitStream->Write(m_Velocity.y);
|
||||
outBitStream->Write(m_Velocity.z);
|
||||
m_DirtyVelocity = false;
|
||||
}
|
||||
|
||||
outBitStream->Write(bIsInitialUpdate || m_DirtyAngularVelocity);
|
||||
|
||||
if (bIsInitialUpdate || m_DirtyAngularVelocity) {
|
||||
bool isAngularVelocityZero = m_AngularVelocity == NiPoint3::ZERO;
|
||||
outBitStream->Write(isAngularVelocityZero);
|
||||
if (isAngularVelocityZero) {
|
||||
outBitStream->Write(m_AngularVelocity.x);
|
||||
outBitStream->Write(m_AngularVelocity.y);
|
||||
outBitStream->Write(m_AngularVelocity.z);
|
||||
m_DirtyAngularVelocity = false;
|
||||
}
|
||||
|
||||
outBitStream->Write0(); // local_space_info. TODO: Implement this
|
||||
|
Loading…
Reference in New Issue
Block a user