File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -337,10 +337,11 @@ public int getShields() {
337337 * @see UnitType#maxEnergy
338338 */
339339 public int getEnergy () {
340+ int energy = unitData .getEnergy ();
340341 if (game .isLatComEnabled () && self ().energy .valid (game .getFrameCount ())) {
341- return self ().energy .get ();
342+ return energy + self ().energy .get ();
342343 }
343- return unitData . getEnergy () ;
344+ return energy ;
344345 }
345346
346347 /**
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ class UnitSelf {
2424 IntegerCache remainingTrainTime = new IntegerCache ();
2525 UpgradeTypeCache upgrade = new UpgradeTypeCache ();
2626 IntegerCache remainingUpgradeTime = new IntegerCache ();
27- IntegerCache energy = new IntegerCache ();
2827 BooleanCache isMoving = new BooleanCache ();
2928 BooleanCache isGathering = new BooleanCache ();
3029 IntegerCache rallyPositionX = new IntegerCache ();
@@ -37,6 +36,7 @@ class UnitSelf {
3736
3837 IntegerCache hitPoints = new IntegerCache ();
3938 IntegerCache trainingQueueCount = new IntegerCache ();
39+ IntegerCache energy = new IntegerCache ();
4040
4141
4242 UnitSelf () {
You can’t perform that action at this time.
0 commit comments