mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 21:47:24 +00:00
I am throwing this one out later.
This commit is contained in:
parent
8a512e5c76
commit
d2a7e147cc
@ -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<bool>(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<bool>(false);
|
||||
outBitStream->Write<bool>(false);
|
||||
outBitStream->Write0();
|
||||
outBitStream->Write0();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
outBitStream->Write<bool>(true);
|
||||
outBitStream->Write1();
|
||||
|
||||
auto hasPath = !m_PathingStopped && !m_PathName.empty();
|
||||
outBitStream->Write(hasPath);
|
||||
|
@ -6,12 +6,10 @@
|
||||
#ifndef MOVINGPLATFORMCOMPONENT_H
|
||||
#define MOVINGPLATFORMCOMPONENT_H
|
||||
|
||||
#include "RakNetTypes.h"
|
||||
#include "NiPoint3.h"
|
||||
#include <string>
|
||||
|
||||
#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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user