[Server] Turn readWorldstate and writeWorldstate into static variables

remotes/1728160796594174844/tmp_0.7.0-alpha
David Cernat 7 years ago
parent c3ff273a22
commit d778bc3b8a

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

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

Loading…
Cancel
Save