summaryrefslogtreecommitdiff
path: root/src/game-server/gamehandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-10 01:43:59 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-10 20:42:24 +0100
commit8172b66469a257b61769e0ce69baa1a0f75eb785 (patch)
treee19beffb3d3b92703d347f7fd70137a0a2b44e2f /src/game-server/gamehandler.cpp
parentd4ee26fb6b05c07c84f61799bcb2cba81873b873 (diff)
downloadmanaserv-8172b66469a257b61769e0ce69baa1a0f75eb785.tar.gz
manaserv-8172b66469a257b61769e0ce69baa1a0f75eb785.tar.bz2
manaserv-8172b66469a257b61769e0ce69baa1a0f75eb785.tar.xz
manaserv-8172b66469a257b61769e0ce69baa1a0f75eb785.zip
Made the game server execute the chr_respawn_accept script even
in case of disconnection. I made the Character::disconnected() function handle that case, permitting also to centralize GameState::remove() calls there. I also made the GameState::enqueueWarp() function test whether the Character pointer is about to be deleted, so that the warp can be handled directly to avoid a crash. Last but not least, I also made the Character::update() function not update the Character specials and hp to avoid discrepancies seen in the client. Resolves: Mana-Mantis #309. Reviewed-by: Ablu.
Diffstat (limited to 'src/game-server/gamehandler.cpp')
-rw-r--r--src/game-server/gamehandler.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp
index af6cff1c..cb6c820f 100644
--- a/src/game-server/gamehandler.cpp
+++ b/src/game-server/gamehandler.cpp
@@ -72,7 +72,6 @@ void GameHandler::computerDisconnected(NetComputer *comp)
else if (Character *ch = computer.character)
{
accountHandler->sendCharacterData(ch);
- GameState::remove(ch);
ch->disconnected();
delete ch;
}
@@ -695,12 +694,9 @@ void GameHandler::handleDisconnect(GameClient &client, MessageIn &message)
client.character->getDatabaseID(),
magic_token);
}
- // TODO: implement a delayed remove
- GameState::remove(client.character);
-
accountHandler->sendCharacterData(client.character);
- // Done with the character
+ // Done with the character, also handle possible respawn case
client.character->disconnected();
delete client.character;
client.character = 0;