瀏覽代碼

no message

Edgardo Palza 8 年之前
父節點
當前提交
393ca8cb96
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/classes/HolonObject.java

+ 3 - 1
src/classes/HolonObject.java

@@ -61,7 +61,9 @@ public class HolonObject extends CpsObject {
 	public float getCurrentEnergy() {
 		float temp = 0;
 		for (HolonElement e : getElements()) {
-			temp = temp + e.getTotalEnergy();
+			if (e.getActive()) {
+				temp = temp + e.getTotalEnergy();
+			}
 		}
 		currentEnergy = temp;
 		return currentEnergy;