diff options
author | Stijn Buys <ingar@osirion.org> | 2008-03-02 22:55:30 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-03-02 22:55:30 +0000 |
commit | e379b1bfeb231716e07f0e4ae9ef024be9bfd08f (patch) | |
tree | 6258754959e820a9a94726a4b1a119c301581111 /src/core | |
parent | 6e08b92bd4f3e32fdf550f0a3e950e3101a1b06f (diff) |
added target_engine support
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/entity.cc | 2 | ||||
-rw-r--r-- | src/core/gameserver.cc | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index 2a0518a..097b322 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -61,6 +61,8 @@ void Entity::remove(unsigned int id) if (it != registry.end()) { delete((*it).second); registry.erase(it); + } else { + con_warn << "Could not remove entity " << id << "!\n"; } } diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index 6294a31..839ed03 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -271,6 +271,22 @@ void GameServer::frame(float seconds) client->player()->player_dirty = false; } } + + } else { + + // local update stub + std::map<unsigned int, Entity *>::iterator it; + for (it=Entity::registry.begin(); it != Entity::registry.end(); it++) { + + Entity *entity = (*it).second; + if (entity->entity_destroyed) { + core::Entity::remove(entity->id()); + } else if (entity->entity_created) { + entity->entity_created = false; + + } + entity->entity_dirty = false; + } } } |