diff options
-rw-r--r-- | src/main.cpp | 5 | ||||
-rw-r--r-- | src/net/ea/maphandler.cpp | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 40b30899..07bcd3f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -159,6 +159,7 @@ extern Net::Connection *accountServerConnection; #endif Graphics *graphics; +Game *game = 0; unsigned char state; std::string errorMessage; @@ -910,7 +911,6 @@ int main(int argc, char *argv[]) // Needs to be created in main, as the updater uses it guiPalette = new Palette; - Game *game = NULL; Window *currentDialog = NULL; #ifdef TMWSERV_SUPPORT QuitDialog* quitDialog = NULL; @@ -1290,6 +1290,7 @@ int main(int argc, char *argv[]) game = new Game; game->logic(); delete game; + game = 0; state = STATE_EXIT; @@ -1467,9 +1468,9 @@ int main(int argc, char *argv[]) desktop = NULL; logger->log("State: GAME"); - game = new Game; game->logic(); delete game; + game = 0; state = STATE_EXIT; break; diff --git a/src/net/ea/maphandler.cpp b/src/net/ea/maphandler.cpp index 76b3c480..c7ff0ec7 100644 --- a/src/net/ea/maphandler.cpp +++ b/src/net/ea/maphandler.cpp @@ -27,6 +27,7 @@ #include "net/messagein.h" #include "net/messageout.h" +#include "game.h" #include "localplayer.h" #include "log.h" #include "main.h" @@ -37,6 +38,7 @@ #include "utils/stringutils.h" Net::MapHandler *mapHandler; +extern Game *game; namespace EAthena { @@ -65,6 +67,7 @@ void MapHandler::handleMessage(MessageIn &msg) logger->log("Protocol: Player start position: (%d, %d), Direction: %d", player_node->mX, player_node->mY, direction); state = STATE_GAME; + game = new Game; break; case SMSG_SERVER_PING: |