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/gameconnection.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/gameconnection.cc')
-rw-r--r--src/core/gameconnection.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc
index 7bdadad..1fbcf26 100644
--- a/src/core/gameconnection.cc
+++ b/src/core/gameconnection.cc
@@ -262,14 +262,14 @@ void GameConnection::frame(unsigned long timestamp)
}
}
- // delete entities were required
- if (entity->destroyed()) {
+ // remove deleted entities
+ if ((*it).second->died()) {
+ delete (*it).second;
+ (*it).second = 0;
Entity::registry().erase(it++);
} else {
++it;
}
-
-
}
float f = 0;