Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/entity.cc2
-rw-r--r--src/core/gameserver.cc16
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;
+ }
}
}