Skip to content

Commit 7309885

Browse files
committed
sim: drop HFRs during prespawn
This fixes the brief flash of a big HFR list and also works around an as-yet unresolved bug where aircraft would not be in the STARSComputer HFR list but would be in the Sim DepartureState, which in turn prevented departures from launching since the Sim thought there was an unreleased one in front.
1 parent 6ef1b4c commit 7309885

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/sim/spawn.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ func (s *Sim) spawnDepartures() {
508508
// passed since the last one.
509509
if now.After(depState.NextIFRSpawn) {
510510
if ac, err := s.makeNewIFRDeparture(airport, runway); ac != nil && err == nil {
511-
if !s.prespawnUncontrolledOnly || !s.isControlled(ac, true) { // keep virtual-controller-only ones
511+
dropUncontrolled := s.prespawnUncontrolledOnly && s.isControlled(ac, true)
512+
dropHFR := s.prespawn && ac.HoldForRelease
513+
if !dropUncontrolled && !dropHFR {
512514
s.addDepartureToPool(ac, runway)
513515
r := scaleRate(depState.IFRSpawnRate, s.State.LaunchConfig.DepartureRateScale)
514516
depState.NextIFRSpawn = now.Add(randomWait(r, false))

0 commit comments

Comments
 (0)