[Server] Turn readWorldstate and writeWorldstate into static variables

pull/471/head
David Cernat 7 years ago
parent c3ff273a22
commit d778bc3b8a

@ -1,5 +1,4 @@
#include <components/openmw-mp/NetworkMessages.hpp> #include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Base/BaseWorldstate.hpp>
#include <apps/openmw-mp/Networking.hpp> #include <apps/openmw-mp/Networking.hpp>
#include <apps/openmw-mp/Player.hpp> #include <apps/openmw-mp/Player.hpp>
@ -11,8 +10,8 @@
using namespace std; using namespace std;
using namespace mwmp; using namespace mwmp;
BaseWorldstate *readWorldstate; BaseWorldstate *WorldstateFunctions::readWorldstate;
BaseWorldstate writeWorldstate; BaseWorldstate WorldstateFunctions::writeWorldstate;
void WorldstateFunctions::ReadReceivedWorldstate() noexcept void WorldstateFunctions::ReadReceivedWorldstate() noexcept
{ {

@ -1,6 +1,7 @@
#ifndef OPENMW_WORLDSTATEAPI_HPP #ifndef OPENMW_WORLDSTATEAPI_HPP
#define OPENMW_WORLDSTATEAPI_HPP #define OPENMW_WORLDSTATEAPI_HPP
#include <components/openmw-mp/Base/BaseWorldstate.hpp>
#include "../Types.hpp" #include "../Types.hpp"
#define WORLDSTATEAPI \ #define WORLDSTATEAPI \
@ -61,6 +62,9 @@ class WorldstateFunctions
{ {
public: public:
static mwmp::BaseWorldstate *readWorldstate;
static mwmp::BaseWorldstate writeWorldstate;
/** /**
* \brief Use the last worldstate received by the server as the one being read. * \brief Use the last worldstate received by the server as the one being read.
* *

Loading…
Cancel
Save