diff --git a/sim/core/apl.go b/sim/core/apl.go index 7b0f568cab..88741763e5 100644 --- a/sim/core/apl.go +++ b/sim/core/apl.go @@ -215,7 +215,7 @@ func (apl *APLRotation) DoNextAction(sim *Simulation) { apl.unit.DoNothing() } - apl.unit.DoneAPLLoop(sim, gcdReady) + apl.unit.DoneAPLLoop(sim, !gcdReady) } func (apl *APLRotation) getNextAction(sim *Simulation) *APLAction { diff --git a/sim/core/gcd.go b/sim/core/gcd.go index 6741047306..b6a08c02fe 100644 --- a/sim/core/gcd.go +++ b/sim/core/gcd.go @@ -110,7 +110,9 @@ func (unit *Unit) WaitUntil(sim *Simulation, readyTime time.Duration) { if readyTime < sim.CurrentTime { panic(unit.Label + ": cannot wait negative time") } - unit.waitStartTime = sim.CurrentTime + if !unit.IsWaiting() { + unit.waitStartTime = sim.CurrentTime + } unit.SetGCDTimer(sim, readyTime) if sim.Log != nil && readyTime > sim.CurrentTime { unit.Log(sim, "Pausing GCD for %s due to rotation / CDs.", readyTime-sim.CurrentTime)