mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
fix: laggy property models (and probably more) (#1646)
* fix laggy property models (and probably more) global fix correcting the initial physics motion state from 0 to 5 (confirm in client). packet captures from a few worlds (didnt scan more than 5 files) show that the value for simple physics was either 5, or 4 for property models, or 1 for property models with behaviors. properties with pre-built models no longer lag and values of physics types should be correct across the board * will test this briefly
This commit is contained in:
@@ -27,6 +27,7 @@ SimplePhysicsComponent::SimplePhysicsComponent(Entity* parent, uint32_t componen
|
||||
} else {
|
||||
SetClimbableType(eClimbableType::CLIMBABLE_TYPE_NOT);
|
||||
}
|
||||
m_PhysicsMotionState = m_Parent->GetVarAs<uint32_t>(u"motionType");
|
||||
}
|
||||
|
||||
SimplePhysicsComponent::~SimplePhysicsComponent() {
|
||||
@@ -47,11 +48,10 @@ void SimplePhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bool bIs
|
||||
}
|
||||
|
||||
// Physics motion state
|
||||
if (m_PhysicsMotionState != 0) {
|
||||
outBitStream.Write1();
|
||||
outBitStream.Write(m_DirtyPhysicsMotionState || bIsInitialUpdate);
|
||||
if (m_DirtyPhysicsMotionState || bIsInitialUpdate) {
|
||||
outBitStream.Write<uint32_t>(m_PhysicsMotionState);
|
||||
} else {
|
||||
outBitStream.Write0();
|
||||
m_DirtyPhysicsMotionState = false;
|
||||
}
|
||||
PhysicsComponent::Serialize(outBitStream, bIsInitialUpdate);
|
||||
}
|
||||
@@ -61,5 +61,6 @@ uint32_t SimplePhysicsComponent::GetPhysicsMotionState() const {
|
||||
}
|
||||
|
||||
void SimplePhysicsComponent::SetPhysicsMotionState(uint32_t value) {
|
||||
m_DirtyPhysicsMotionState = m_PhysicsMotionState != value;
|
||||
m_PhysicsMotionState = value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user