diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-29 14:17:22 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-29 14:17:22 +0000 |
commit | 26b3e1094d85ef89c90376688000836c8ee43979 (patch) | |
tree | f934d936d7c8319e742e946a6bb5f37ab7289b30 /src/game-server/state.cpp | |
parent | b82bf7df7053a78d51706a5a017d61f564e4677e (diff) | |
download | manaserv-26b3e1094d85ef89c90376688000836c8ee43979.tar.gz manaserv-26b3e1094d85ef89c90376688000836c8ee43979.tar.bz2 manaserv-26b3e1094d85ef89c90376688000836c8ee43979.tar.xz manaserv-26b3e1094d85ef89c90376688000836c8ee43979.zip |
Replaced event system. Fixed race condition between quest variable recovery and character removal.
Diffstat (limited to 'src/game-server/state.cpp')
-rw-r--r-- | src/game-server/state.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp index ed111abc..8545820d 100644 --- a/src/game-server/state.cpp +++ b/src/game-server/state.cpp @@ -404,7 +404,9 @@ void GameState::update() remove(o); if (o->getType() == OBJECT_CHARACTER) { - gameHandler->kill(static_cast< Character * >(o)); + Character *ch = static_cast< Character * >(o); + ch->disconnected(); + gameHandler->kill(ch); } delete o; } break; @@ -456,6 +458,8 @@ void GameState::insert(Thing *ptr) return; } + ptr->inserted(); + if (ptr->isVisible()) { Object *obj = static_cast< Object * >(ptr); @@ -478,6 +482,8 @@ void GameState::remove(Thing *ptr) assert(!dbgLockObjects); MapComposite *map = ptr->getMap(); + ptr->removed(); + if (ptr->canMove()) { if (ptr->getType() == OBJECT_CHARACTER) |