From 96d877fa2b9bbec546b83cbbc6d16664116e1fb9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 8 Oct 2011 02:04:33 +0300 Subject: Add checks and fix code style. --- src/net/tmwa/gamehandler.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/net/tmwa/gamehandler.cpp') diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 242e9f9de..adaaa067b 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -107,9 +107,16 @@ void GameHandler::connect() if (Client::getState() == STATE_CONNECT_GAME) { - mCharID = player_node->getId(); // Change the player's ID to the account ID to match what eAthena uses - player_node->setId(token.account_ID); + if (player_node) + { + mCharID = player_node->getId(); + player_node->setId(token.account_ID); + } + else + { + mCharID = 0; + } } // Send login infos -- cgit v1.2.3-60-g2f50