diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 1b609f89..8a5dd5b6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,6 +99,9 @@ ChatChannelManager *chatChannelManager; /** Core game message handler */ GameHandler *gameHandler; +/** Global game state */ +tmwserv::State *gameState; + /** * Initializes the server. */ @@ -340,7 +343,7 @@ int main(int argc, char *argv[]) // // create state machine - State &state = State::instance(); + gameState = new State; // initialize world timer worldTimer.start(); @@ -365,7 +368,7 @@ int main(int argc, char *argv[]) chatHandler->process(); gameHandler->process(); // Update all active objects/beings - state.update(); + gameState->update(); // Send potentially urgent outgoing messages gameHandler->flush(); } @@ -374,6 +377,7 @@ int main(int argc, char *argv[]) LOG_INFO("Received: Quit signal, closing down...", 0); gameHandler->stopListen(); + delete gameState; chatHandler->stopListen(); accountHandler->stopListen(); deinitialize(); |