diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-27 23:30:18 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-27 23:30:18 +0200 |
commit | 5bfc376d1cee0f941657a771b87a3ee030d31c56 (patch) | |
tree | de739c3845aa3f5bb9cb4bb79236551d5f3fc8b5 /src/game-server/gamehandler.cpp | |
parent | c53bc90dbaa876a86f762a3d864b1f920e2b8071 (diff) | |
parent | d4f3105d9a879f27baad6e43b8b3cb6fe2f0ef50 (diff) | |
download | manaserv-5bfc376d1cee0f941657a771b87a3ee030d31c56.tar.gz manaserv-5bfc376d1cee0f941657a771b87a3ee030d31c56.tar.bz2 manaserv-5bfc376d1cee0f941657a771b87a3ee030d31c56.tar.xz manaserv-5bfc376d1cee0f941657a771b87a3ee030d31c56.zip |
Merge branch 'master' into lpc2012
Diffstat (limited to 'src/game-server/gamehandler.cpp')
-rw-r--r-- | src/game-server/gamehandler.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp index 95663168..79a14c60 100644 --- a/src/game-server/gamehandler.cpp +++ b/src/game-server/gamehandler.cpp @@ -116,7 +116,7 @@ void GameHandler::completeServerChange(int id, const std::string &token, c->character->getComponent<CharacterComponent>()->disconnected( *c->character); delete c->character; - c->character = NULL; + c->character = nullptr; c->status = CLIENT_LOGIN; return; } @@ -347,14 +347,13 @@ void GameHandler::addPendingCharacter(const std::string &token, Entity *ch) again, yet the game server has not yet detected the lost connection. */ int id = ch->getComponent<CharacterComponent>()->getDatabaseID(); + for (NetComputers::const_iterator i = clients.begin(), i_end = clients.end(); i != i_end; ++i) { GameClient *c = static_cast< GameClient * >(*i); Entity *old_ch = c->character; - const int oldId = old_ch->getComponent<CharacterComponent>() - ->getDatabaseID(); - if (old_ch && oldId == id) + if (old_ch && id == old_ch->getComponent<CharacterComponent>()->getDatabaseID()) { if (c->status != CLIENT_CONNECTED) { |