summaryrefslogtreecommitdiff
path: root/src/game-server/state.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-29 14:17:22 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-29 14:17:22 +0000
commit26b3e1094d85ef89c90376688000836c8ee43979 (patch)
treef934d936d7c8319e742e946a6bb5f37ab7289b30 /src/game-server/state.cpp
parentb82bf7df7053a78d51706a5a017d61f564e4677e (diff)
downloadmanaserv-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.cpp8
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)