Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-11-10 22:23:50 +0000
committerStijn Buys <ingar@osirion.org>2013-11-10 22:23:50 +0000
commit8039544940b6145dcc8c63bcd4e06073ed61801e (patch)
treef3adf9eebb1ffe6a8c53e57c64546eeaa61a3517 /src/core/gameserver.cc
parent3b75b41676bd2851b6d2b61d3e3213ee50078870 (diff)
Renamed entity_destroyed to entity_died to prevent confusion with the Entity::Destroyed state,
fixed a potential memory leak.
Diffstat (limited to 'src/core/gameserver.cc')
-rw-r--r--src/core/gameserver.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc
index 9e24c64..86f130f 100644
--- a/src/core/gameserver.cc
+++ b/src/core/gameserver.cc
@@ -652,7 +652,7 @@ 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;
- if (!entity->destroyed()) {
+ if (!entity->died()) {
entity->frame(elapsed);
}
@@ -670,7 +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) && !entity->destroyed()) {
+ if (zone && entity->has_flag(Entity::KeepAlive) && !entity->died()) {
// reset timeout counter if the zone is active
if (zone->keepalive_run() && zone->keepalive_box().inside(entity->location())) {
entity->set_keepalive(this->timestamp());
@@ -723,7 +723,7 @@ void GameServer::frame(const unsigned long timestamp)
}
// view is to be deleted
- if (view->destroyed()) {
+ if (view->died()) {
if (control) {
// player is docked at deleted entity
if (control->state() == Entity::Docked) {
@@ -750,7 +750,7 @@ void GameServer::frame(const unsigned long timestamp)
// remove deleted entities and mark remaining entities as updated
for (Entity::Registry::iterator it = Entity::registry().begin(); it != Entity::registry().end();) {
// remove deleted entities
- if ((*it).second->destroyed()) {
+ if ((*it).second->died()) {
delete (*it).second;
(*it).second = 0;
Entity::registry().erase(it++);