Skip to content

Commit

Permalink
Merge pull request #3881 from wowsims/apl
Browse files Browse the repository at this point in the history
Fix logic so energy thresholding gracefully falls back to always-on f…
  • Loading branch information
jimmyt857 committed Oct 14, 2023
2 parents 06fb5be + 855242b commit 0a3db06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sim/core/energy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a3db06

Please sign in to comment.