From d2a7e147cc9e5eaced313f99ab4dbe94dd7feb12 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sun, 9 Jul 2023 20:44:08 -0700 Subject: [PATCH] I am throwing this one out later. --- dGame/dComponents/MovingPlatformComponent.cpp | 14 ++++++-------- dGame/dComponents/MovingPlatformComponent.h | 3 --- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/dGame/dComponents/MovingPlatformComponent.cpp b/dGame/dComponents/MovingPlatformComponent.cpp index 39151f5f..6872f65a 100644 --- a/dGame/dComponents/MovingPlatformComponent.cpp +++ b/dGame/dComponents/MovingPlatformComponent.cpp @@ -1,6 +1,6 @@ /* * Darkflame Universe - * Copyright 2019 + * Copyright 2023 */ #include "MovingPlatformComponent.h" @@ -15,7 +15,7 @@ #include "Zone.h" MoverSubComponent::MoverSubComponent(const NiPoint3& startPos) { - mPosition = {}; + mPosition = NiPoint3::ZERO; mState = eMovementPlatformState::Stopped; mDesiredWaypointIndex = 0; // -1; @@ -30,8 +30,6 @@ MoverSubComponent::MoverSubComponent(const NiPoint3& startPos) { mIdleTimeElapsed = 0.0f; } -MoverSubComponent::~MoverSubComponent() = default; - void MoverSubComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) const { outBitStream->Write(true); @@ -62,7 +60,7 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const std::stri m_Path = dZoneManager::Instance()->GetZone()->GetPath(pathName); m_NoAutoStart = false; - if (m_Path == nullptr) { + if (!m_Path) { Game::logger->Log("MovingPlatformComponent", "Path not found: %s", pathName.c_str()); } } @@ -75,13 +73,13 @@ void MovingPlatformComponent::Serialize(RakNet::BitStream* outBitStream, bool bI // Here we don't serialize the moving platform to let the client simulate the movement if (!m_Serialize) { - outBitStream->Write(false); - outBitStream->Write(false); + outBitStream->Write0(); + outBitStream->Write0(); return; } - outBitStream->Write(true); + outBitStream->Write1(); auto hasPath = !m_PathingStopped && !m_PathName.empty(); outBitStream->Write(hasPath); diff --git a/dGame/dComponents/MovingPlatformComponent.h b/dGame/dComponents/MovingPlatformComponent.h index cd1714cc..232505df 100644 --- a/dGame/dComponents/MovingPlatformComponent.h +++ b/dGame/dComponents/MovingPlatformComponent.h @@ -6,12 +6,10 @@ #ifndef MOVINGPLATFORMCOMPONENT_H #define MOVINGPLATFORMCOMPONENT_H -#include "RakNetTypes.h" #include "NiPoint3.h" #include #include "dCommonVars.h" -#include "EntityManager.h" #include "Component.h" #include "eMovementPlatformState.h" #include "eReplicaComponentType.h" @@ -36,7 +34,6 @@ enum class eMoverSubComponentType : uint32_t { class MoverSubComponent { public: MoverSubComponent(const NiPoint3& startPos); - ~MoverSubComponent(); void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) const;