mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 23:17:28 +00:00
Add random end of race behavior (#1056)
* randominze between 0 and 7 inclusive for the different animation types * Make the end behavior deterministic unpon loading So that all players see the same animations for each other
This commit is contained in:
parent
fbfa778d3d
commit
f60ea40acc
@ -11,6 +11,7 @@ VehiclePhysicsComponent::VehiclePhysicsComponent(Entity* parent) : Component(par
|
|||||||
m_DirtyPosition = true;
|
m_DirtyPosition = true;
|
||||||
m_DirtyVelocity = true;
|
m_DirtyVelocity = true;
|
||||||
m_DirtyAngularVelocity = true;
|
m_DirtyAngularVelocity = true;
|
||||||
|
m_EndBehavior = GeneralUtils::GenerateRandomNumber<uint32_t>(0, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
VehiclePhysicsComponent::~VehiclePhysicsComponent() {
|
VehiclePhysicsComponent::~VehiclePhysicsComponent() {
|
||||||
@ -93,7 +94,7 @@ void VehiclePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bI
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bIsInitialUpdate) {
|
if (bIsInitialUpdate) {
|
||||||
outBitStream->Write<uint8_t>(5);
|
outBitStream->Write<uint8_t>(m_EndBehavior);
|
||||||
outBitStream->Write1();
|
outBitStream->Write1();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,4 +109,5 @@ private:
|
|||||||
bool m_IsOnRail;
|
bool m_IsOnRail;
|
||||||
|
|
||||||
float m_SoftUpdate = 0;
|
float m_SoftUpdate = 0;
|
||||||
|
uint32_t m_EndBehavior;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user