Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-10-14 21:29:12 +0000
committerStijn Buys <ingar@osirion.org>2012-10-14 21:29:12 +0000
commit9554f5be113b7f5d697a2eb8e782f70d6911be19 (patch)
treee2fcffb42756b05e0938ebf3cedf8df53cc1426c /src
parent47f64f234670f2947f972bdb5d514d8c1e10a7cc (diff)
Disable physics simulation for destroyed entities in Entity::reset()
Diffstat (limited to 'src')
-rw-r--r--src/core/entity.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 6ae9e87..825f9bf 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -502,9 +502,10 @@ MenuDescription *Entity::find_menu(std::string const &label)
void Entity::remove_menu(std::string const &label)
{
for (Menus::iterator it = menus().begin(); it != menus().end(); it++) {
- if (label.compare((*it)->label()) == 0)
+ if (label.compare((*it)->label()) == 0) {
menus().erase(it);
- return;
+ return;
+ }
}
}
@@ -702,7 +703,7 @@ void EntityDynamic::reset()
}
// remove Docked and Destroyed entities from the physics simulation
- if ((state() == core::Entity::Docked) || (state() == core::Entity::Destroyed)) {
+ if (destroyed() || (state() == core::Entity::Docked) || (state() == core::Entity::Destroyed)) {
if (entity_body) {
@@ -1228,7 +1229,7 @@ void EntityControlable::reset()
}
// remove Docked and Destroyed entities from the physics simulation
- if ((state() == core::Entity::Docked) || (state() == core::Entity::Destroyed)) {
+ if (destroyed() || (state() == core::Entity::Docked) || (state() == core::Entity::Destroyed)) {
if (entity_body) {