Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/gameserver.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc
index 003b9c6..9e24c64 100644
--- a/src/core/gameserver.cc
+++ b/src/core/gameserver.cc
@@ -622,6 +622,7 @@ void GameServer::frame(const unsigned long timestamp)
// Note: zone->keepalive_run() is set to true by EntityControlable::frame()
zone->set_keepalive_run(false);
}
+
// update zone keepalive state
for (Players::iterator it = game_players.begin(); it != game_players.end(); ++it) {
@@ -635,9 +636,8 @@ void GameServer::frame(const unsigned long timestamp)
view->zone()->keepalive_box().expand(view->location());
}
} else {
- EntityControlable *controlable = (*it)->control();
+ EntityControlable *controlable = (*it)->control();
if (controlable && controlable->zone()) {
-
// add player controlable to keepalive bounding box
if (!controlable->zone()->keepalive_run()) {
controlable->zone()->keepalive_box().assign(controlable->location());
@@ -652,8 +652,9 @@ void GameServer::frame(const unsigned long timestamp)
// run entity game frames
for (Entity::Registry::iterator it = Entity::registry().begin(); it != Entity::registry().end(); ++it) {
Entity *entity = (*it).second;
-
- entity->frame(elapsed);
+ if (!entity->destroyed()) {
+ entity->frame(elapsed);
+ }
}
@@ -669,8 +670,7 @@ void GameServer::frame(const unsigned long timestamp)
for (Entity::Registry::iterator it = Entity::registry().begin(); it != Entity::registry().end(); ++it) {
Entity *entity = (*it).second;
Zone *zone = entity->zone();
- if (zone && entity->has_flag(Entity::KeepAlive)) {
-
+ if (zone && entity->has_flag(Entity::KeepAlive) && !entity->destroyed()) {
// reset timeout counter if the zone is active
if (zone->keepalive_run() && zone->keepalive_box().inside(entity->location())) {
entity->set_keepalive(this->timestamp());