diff --git a/sim/core/energy.go b/sim/core/energy.go index e5bb1cef71..81b3718ec9 100644 --- a/sim/core/energy.go +++ b/sim/core/energy.go @@ -164,7 +164,7 @@ func (eb *energyBar) addEnergyInternal(sim *Simulation, amount float64, metrics eb.unit.Log(sim, "Gained %0.3f energy from %s (%0.3f --> %0.3f).", amount, metrics.ActionID, eb.currentEnergy, newEnergy) } - crossedThreshold := eb.cumulativeEnergyDecisionThresholds != nil && eb.cumulativeEnergyDecisionThresholds[int(eb.currentEnergy)] != eb.cumulativeEnergyDecisionThresholds[int(newEnergy)] + crossedThreshold := eb.cumulativeEnergyDecisionThresholds == nil || eb.cumulativeEnergyDecisionThresholds[int(eb.currentEnergy)] != eb.cumulativeEnergyDecisionThresholds[int(newEnergy)] eb.currentEnergy = newEnergy return crossedThreshold