From 83780affbdfffc73739708e2b8f07a1038eb372e Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sun, 9 Jul 2023 20:56:04 -0700 Subject: [PATCH] MutableModelBehaviorComponent pass --- dGame/dComponents/MovementAIComponent.h | 2 +- .../MutableModelBehaviorComponent.cpp | 17 ++++++++--------- .../dComponents/MutableModelBehaviorComponent.h | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dGame/dComponents/MovementAIComponent.h b/dGame/dComponents/MovementAIComponent.h index 51f77bfa..69b4d060 100644 --- a/dGame/dComponents/MovementAIComponent.h +++ b/dGame/dComponents/MovementAIComponent.h @@ -56,7 +56,7 @@ struct MovementAIInfo { * Component that handles the movement settings of an entity. Not to be confused with the BaseCombatAI component that * actually handles attackig and following enemy entities. */ -class MovementAIComponent : public Component { +class MovementAIComponent final : public Component { public: inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MOVEMENT_AI; diff --git a/dGame/dComponents/MutableModelBehaviorComponent.cpp b/dGame/dComponents/MutableModelBehaviorComponent.cpp index 9dfd041c..f4a52338 100644 --- a/dGame/dComponents/MutableModelBehaviorComponent.cpp +++ b/dGame/dComponents/MutableModelBehaviorComponent.cpp @@ -9,22 +9,21 @@ MutableModelBehaviorComponent::MutableModelBehaviorComponent(Entity* parent) : C m_DirtyModelEditingInfo = false; m_OldObjId = LWOOBJID_EMPTY; m_Editor = LWOOBJID_EMPTY; - } void MutableModelBehaviorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) { outBitStream->Write(m_DirtyModelBehaviorInfo || bIsInitialUpdate); - if (m_DirtyModelBehaviorInfo){ + if (m_DirtyModelBehaviorInfo || bIsInitialUpdate) { outBitStream->Write(m_BehaviorCount); outBitStream->Write(m_IsPaused); - m_DirtyModelBehaviorInfo = false; - } - outBitStream->Write(m_DirtyModelEditingInfo && bIsInitialUpdate); - if (m_DirtyModelEditingInfo && bIsInitialUpdate) { - outBitStream->Write(m_OldObjId); - outBitStream->Write(m_Editor); - m_DirtyModelEditingInfo = false; + outBitStream->Write(m_DirtyModelEditingInfo && bIsInitialUpdate); + if (m_DirtyModelEditingInfo && bIsInitialUpdate) { + outBitStream->Write(m_OldObjId); + outBitStream->Write(m_Editor); + if (!bIsInitialUpdate) m_DirtyModelEditingInfo = false; + } + if (!bIsInitialUpdate) m_DirtyModelBehaviorInfo = false; } } diff --git a/dGame/dComponents/MutableModelBehaviorComponent.h b/dGame/dComponents/MutableModelBehaviorComponent.h index 4aaf5ba0..b869c1f4 100644 --- a/dGame/dComponents/MutableModelBehaviorComponent.h +++ b/dGame/dComponents/MutableModelBehaviorComponent.h @@ -11,7 +11,7 @@ class Entity; /** * Component that represents entities that are a model, e.g. collectible models and BBB models. */ -class MutableModelBehaviorComponent : public Component { +class MutableModelBehaviorComponent final : public Component { public: static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL_BEHAVIOR;