diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-10-08 02:04:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-10-08 02:04:33 +0300 |
commit | 96d877fa2b9bbec546b83cbbc6d16664116e1fb9 (patch) | |
tree | 5b75c3f10217c8515a8e2809892f7526e6efd66f /src/net/tmwa/gamehandler.cpp | |
parent | 29187a2582c04e3ede63f9c58f09dbbe34834a30 (diff) | |
download | manaverse-96d877fa2b9bbec546b83cbbc6d16664116e1fb9.tar.gz manaverse-96d877fa2b9bbec546b83cbbc6d16664116e1fb9.tar.bz2 manaverse-96d877fa2b9bbec546b83cbbc6d16664116e1fb9.tar.xz manaverse-96d877fa2b9bbec546b83cbbc6d16664116e1fb9.zip |
Add checks and fix code style.
Diffstat (limited to 'src/net/tmwa/gamehandler.cpp')
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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 |