I am throwing this one out later.

This commit is contained in:
David Markowitz 2023-07-09 20:44:08 -07:00
parent 8a512e5c76
commit d2a7e147cc
2 changed files with 6 additions and 11 deletions

View File

@ -1,6 +1,6 @@
/* /*
* Darkflame Universe * Darkflame Universe
* Copyright 2019 * Copyright 2023
*/ */
#include "MovingPlatformComponent.h" #include "MovingPlatformComponent.h"
@ -15,7 +15,7 @@
#include "Zone.h" #include "Zone.h"
MoverSubComponent::MoverSubComponent(const NiPoint3& startPos) { MoverSubComponent::MoverSubComponent(const NiPoint3& startPos) {
mPosition = {}; mPosition = NiPoint3::ZERO;
mState = eMovementPlatformState::Stopped; mState = eMovementPlatformState::Stopped;
mDesiredWaypointIndex = 0; // -1; mDesiredWaypointIndex = 0; // -1;
@ -30,8 +30,6 @@ MoverSubComponent::MoverSubComponent(const NiPoint3& startPos) {
mIdleTimeElapsed = 0.0f; mIdleTimeElapsed = 0.0f;
} }
MoverSubComponent::~MoverSubComponent() = default;
void MoverSubComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) const { void MoverSubComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) const {
outBitStream->Write<bool>(true); outBitStream->Write<bool>(true);
@ -62,7 +60,7 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const std::stri
m_Path = dZoneManager::Instance()->GetZone()->GetPath(pathName); m_Path = dZoneManager::Instance()->GetZone()->GetPath(pathName);
m_NoAutoStart = false; m_NoAutoStart = false;
if (m_Path == nullptr) { if (!m_Path) {
Game::logger->Log("MovingPlatformComponent", "Path not found: %s", pathName.c_str()); 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 // Here we don't serialize the moving platform to let the client simulate the movement
if (!m_Serialize) { if (!m_Serialize) {
outBitStream->Write<bool>(false); outBitStream->Write0();
outBitStream->Write<bool>(false); outBitStream->Write0();
return; return;
} }
outBitStream->Write<bool>(true); outBitStream->Write1();
auto hasPath = !m_PathingStopped && !m_PathName.empty(); auto hasPath = !m_PathingStopped && !m_PathName.empty();
outBitStream->Write(hasPath); outBitStream->Write(hasPath);

View File

@ -6,12 +6,10 @@
#ifndef MOVINGPLATFORMCOMPONENT_H #ifndef MOVINGPLATFORMCOMPONENT_H
#define MOVINGPLATFORMCOMPONENT_H #define MOVINGPLATFORMCOMPONENT_H
#include "RakNetTypes.h"
#include "NiPoint3.h" #include "NiPoint3.h"
#include <string> #include <string>
#include "dCommonVars.h" #include "dCommonVars.h"
#include "EntityManager.h"
#include "Component.h" #include "Component.h"
#include "eMovementPlatformState.h" #include "eMovementPlatformState.h"
#include "eReplicaComponentType.h" #include "eReplicaComponentType.h"
@ -36,7 +34,6 @@ enum class eMoverSubComponentType : uint32_t {
class MoverSubComponent { class MoverSubComponent {
public: public:
MoverSubComponent(const NiPoint3& startPos); MoverSubComponent(const NiPoint3& startPos);
~MoverSubComponent();
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) const; void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) const;