summaryrefslogtreecommitdiff
path: root/src/game-server/gamehandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/gamehandler.cpp')
-rw-r--r--src/game-server/gamehandler.cpp7
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)
{