Просмотр исходного кода

Merge pull request #440 from wivlaro/no-update-disabled

Disabled entities are not supposed to be updated
Ivan Safrin 12 лет назад
Родитель
Сommit
6a5dbbf15f
1 измененных файлов с 7 добавлено и 5 удалено
  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;
-}
+}