From e87e1dbb3013c2b09ac218809bce8e866f11a87f Mon Sep 17 00:00:00 2001 From: David Cernat Date: Mon, 21 May 2018 07:12:55 +0300 Subject: [PATCH] [General] Fix Worldstate packets by adding missing lines --- apps/openmw-mp/Networking.cpp | 2 ++ apps/openmw/mwmp/processors/WorldstateProcessor.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index f6e7f6016..a2bda22ab 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -53,6 +53,7 @@ Networking::Networking(RakNet::RakPeerInterface *peer) : mclient(nullptr) playerPacketController->SetStream(0, &bsOut); actorPacketController->SetStream(0, &bsOut); objectPacketController->SetStream(0, &bsOut); + worldstatePacketController->SetStream(0, &bsOut); running = true; exitCode = 0; @@ -74,6 +75,7 @@ Networking::~Networking() delete playerPacketController; delete actorPacketController; delete objectPacketController; + delete worldstatePacketController; } void Networking::setServerPassword(std::string passw) noexcept diff --git a/apps/openmw/mwmp/processors/WorldstateProcessor.cpp b/apps/openmw/mwmp/processors/WorldstateProcessor.cpp index 684e7d355..693241ace 100644 --- a/apps/openmw/mwmp/processors/WorldstateProcessor.cpp +++ b/apps/openmw/mwmp/processors/WorldstateProcessor.cpp @@ -1,6 +1,7 @@ +#include "../Main.hpp" #include "../Networking.hpp" + #include "WorldstateProcessor.hpp" -#include "../Main.hpp" using namespace mwmp; @@ -14,6 +15,8 @@ bool WorldstateProcessor::Process(RakNet::Packet &packet, BaseWorldstate &worlds worldstate.guid = guid; WorldstatePacket *myPacket = Main::get().getNetworking()->getWorldstatePacket(packet.data[0]); + + myPacket->setWorldstate(&worldstate); myPacket->SetReadStream(&bsIn); for (auto &processor : processors)