Edgardo Palza hace 8 años
padre
commit
393ca8cb96
Se han modificado 1 ficheros con 3 adiciones y 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;