Edgardo Palza %!s(int64=8) %!d(string=hai) anos
pai
achega
393ca8cb96
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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;