File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -506,12 +506,16 @@ func (s *Sim) spawnDepartures() {
506
506
507
507
// Possibly spawn another aircraft, depending on how much time has
508
508
// passed since the last one.
509
- if now .After (depState .NextIFRSpawn ) && ! s . prespawnUncontrolledOnly {
509
+ if now .After (depState .NextIFRSpawn ) {
510
510
if ac , err := s .makeNewIFRDeparture (airport , runway ); ac != nil && err == nil {
511
- s .addDepartureToPool (ac , runway )
512
- r := scaleRate (depState .IFRSpawnRate , s .State .LaunchConfig .DepartureRateScale )
513
- depState .NextIFRSpawn = now .Add (randomWait (r , false ))
514
- changed ()
511
+ if ! s .prespawnUncontrolledOnly || ! s .isControlled (ac , true ) { // keep virtual-controller-only ones
512
+ s .addDepartureToPool (ac , runway )
513
+ r := scaleRate (depState .IFRSpawnRate , s .State .LaunchConfig .DepartureRateScale )
514
+ depState .NextIFRSpawn = now .Add (randomWait (r , false ))
515
+ changed ()
516
+ } else {
517
+ s .State .DeleteAircraft (ac )
518
+ }
515
519
}
516
520
}
517
521
if now .After (depState .NextVFRSpawn ) {
You can’t perform that action at this time.
0 commit comments