mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-05-23 15:22:28 +00:00
PlayerForcedMovementComponent pass
This commit is contained in:
parent
28637a206d
commit
598d88b307
@ -1,16 +1,12 @@
|
|||||||
#include "PlayerForcedMovementComponent.h"
|
#include "PlayerForcedMovementComponent.h"
|
||||||
|
|
||||||
PlayerForcedMovementComponent::PlayerForcedMovementComponent(Entity* parent) : Component(parent) {
|
#include "BitStream.h"
|
||||||
m_ParentEntity = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
PlayerForcedMovementComponent::~PlayerForcedMovementComponent() {}
|
|
||||||
|
|
||||||
void PlayerForcedMovementComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
|
void PlayerForcedMovementComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
|
||||||
outBitStream->Write(m_DirtyInfo || bIsInitialUpdate);
|
outBitStream->Write(m_DirtyInfo || bIsInitialUpdate);
|
||||||
if (m_DirtyInfo || bIsInitialUpdate) {
|
if (m_DirtyInfo || bIsInitialUpdate) {
|
||||||
outBitStream->Write(m_PlayerOnRail);
|
outBitStream->Write(m_PlayerOnRail);
|
||||||
outBitStream->Write(m_ShowBillboard);
|
outBitStream->Write(m_ShowBillboard);
|
||||||
|
if (!bIsInitialUpdate) m_DirtyInfo = false;
|
||||||
}
|
}
|
||||||
m_DirtyInfo = false;
|
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,7 @@ public:
|
|||||||
* Constructor for this component
|
* Constructor for this component
|
||||||
* @param parent parent that contains this component
|
* @param parent parent that contains this component
|
||||||
*/
|
*/
|
||||||
PlayerForcedMovementComponent(Entity* parent);
|
PlayerForcedMovementComponent(Entity* parent) : Component(parent) {};
|
||||||
~PlayerForcedMovementComponent() override;
|
|
||||||
|
|
||||||
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
|
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
|
||||||
|
|
||||||
@ -26,28 +25,23 @@ public:
|
|||||||
*
|
*
|
||||||
* @param value if the player is on a rail
|
* @param value if the player is on a rail
|
||||||
*/
|
*/
|
||||||
void SetPlayerOnRail(bool value) { m_PlayerOnRail = value; m_DirtyInfo = true; }
|
void SetPlayerOnRail(bool value) {
|
||||||
|
if (m_PlayerOnRail == value) return;
|
||||||
|
m_PlayerOnRail = value;
|
||||||
|
m_DirtyInfo = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the Show Billboard object
|
* @brief Set the Show Billboard object
|
||||||
*
|
*
|
||||||
* @param value if the billboard should be shown
|
* @param value if the billboard should be shown
|
||||||
*/
|
*/
|
||||||
void SetShowBillboard(bool value) { m_ShowBillboard = value; m_DirtyInfo = true; }
|
void SetShowBillboard(bool value) {
|
||||||
|
if (m_ShowBillboard == value) return;
|
||||||
|
m_ShowBillboard = value;
|
||||||
|
m_DirtyInfo = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Get the Player On Rail object
|
|
||||||
*
|
|
||||||
* @return true
|
|
||||||
* @return false
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Get the Player On Rail object
|
|
||||||
*
|
|
||||||
* @return true
|
|
||||||
* @return false
|
|
||||||
*/
|
|
||||||
bool GetPlayerOnRail() { return m_PlayerOnRail; }
|
bool GetPlayerOnRail() { return m_PlayerOnRail; }
|
||||||
bool GetShowBillboard() { return m_ShowBillboard; }
|
bool GetShowBillboard() { return m_ShowBillboard; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user