Skip to content

Commit

Permalink
do not get next action in onEnergyGain during pre-pull (#3782)
Browse files Browse the repository at this point in the history
* do not get next action in onEnergyGain during pre-pull

* update tests
  • Loading branch information
lime-green committed Sep 29, 2023
1 parent 567c09e commit 15e2e1f
Show file tree
Hide file tree
Showing 3 changed files with 646 additions and 642 deletions.
4 changes: 4 additions & 0 deletions sim/core/energy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func (unit *Unit) EnableEnergyBar(maxEnergy float64, onEnergyGain OnEnergyGain)
unit: unit,
maxEnergy: MaxFloat(100, maxEnergy),
onEnergyGain: func(sim *Simulation) {
if sim.CurrentTime < 0 {
return
}

if !sim.Options.Interactive && (!unit.IsWaitingForEnergy() || unit.DoneWaitingForEnergy(sim)) {
if unit.IsUsingAPL {
unit.Rotation.DoNextAction(sim)
Expand Down
Loading

0 comments on commit 15e2e1f

Please sign in to comment.