Bläddra i källkod

Disabled entities are not supposed to be updated

Bill Robinson 12 år sedan
förälder
incheckning
e111cc163d
1 ändrade filer med 7 tillägg och 5 borttagningar
  1. 7 5
      Core/Contents/Source/PolyEntity.cpp

+ 7 - 5
Core/Contents/Source/PolyEntity.cpp

@@ -414,10 +414,12 @@ void Entity::rebuildTransformMatrix() {
 }
 
 void Entity::doUpdates() {
-	Update();
-	for(int i=0; i < children.size(); i++) {
-		children[i]->doUpdates();
-	}	
+	if (enabled) {
+		Update();
+		for(int i=0; i < children.size(); i++) {
+			children[i]->doUpdates();
+		}
+	}
 }
 
 void Entity::updateEntityMatrix() {
@@ -1114,4 +1116,4 @@ MouseEventResult Entity::onMouseWheelDown(const Ray &ray, int timestamp) {
 		}
 	}
 	return ret;
-}
+}