summaryrefslogtreecommitdiff
path: root/src/net/tmwa/gamehandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-10-08 02:04:33 +0300
committerAndrei Karas <akaras@inbox.ru>2011-10-08 02:04:33 +0300
commit96d877fa2b9bbec546b83cbbc6d16664116e1fb9 (patch)
tree5b75c3f10217c8515a8e2809892f7526e6efd66f /src/net/tmwa/gamehandler.cpp
parent29187a2582c04e3ede63f9c58f09dbbe34834a30 (diff)
downloadmv-96d877fa2b9bbec546b83cbbc6d16664116e1fb9.tar.gz
mv-96d877fa2b9bbec546b83cbbc6d16664116e1fb9.tar.bz2
mv-96d877fa2b9bbec546b83cbbc6d16664116e1fb9.tar.xz
mv-96d877fa2b9bbec546b83cbbc6d16664116e1fb9.zip
Add checks and fix code style.
Diffstat (limited to 'src/net/tmwa/gamehandler.cpp')
-rw-r--r--src/net/tmwa/gamehandler.cpp11
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