breakout possessor from char comp (#606)

* breakout possessor from char comp
Use the correct component for possessor
cleanup scirps that were using possessor improperly
beginnings of mounts

* fix comments
added bounds check
This commit is contained in:
Aaron Kimbrell
2022-06-29 18:50:24 -05:00
committed by GitHub
parent a55162775e
commit 1497d9b35a
9 changed files with 76 additions and 106 deletions

View File

@@ -1,35 +1,21 @@
#include "PossessorComponent.h"
PossessorComponent::PossessorComponent(Entity* parent) : Component(parent)
{
m_Possessable = LWOOBJID_EMPTY;
PossessorComponent::PossessorComponent(Entity* parent) : Component(parent) {
m_Possessable = LWOOBJID_EMPTY;
}
PossessorComponent::~PossessorComponent()
{
}
PossessorComponent::~PossessorComponent() {}
void PossessorComponent::SetPossessable(LWOOBJID value)
{
m_Possessable = value;
}
LWOOBJID PossessorComponent::GetPossessable() const
{
return m_Possessable;
}
void PossessorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags)
{
outBitStream->Write(m_Possessable != LWOOBJID_EMPTY);
if (m_Possessable != LWOOBJID_EMPTY)
{
outBitStream->Write(m_Possessable);
}
}
void PossessorComponent::Update(float deltaTime)
{
void PossessorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
outBitStream->Write(m_DirtyPossesor || bIsInitialUpdate);
if (m_DirtyPossesor || bIsInitialUpdate) {
m_DirtyPossesor = false;
outBitStream->Write(m_Possessable != LWOOBJID_EMPTY);
if (m_Possessable != LWOOBJID_EMPTY) {
outBitStream->Write(m_Possessable);
}
outBitStream->Write(m_PossessableType);
}
}