Skip to content

Commit 9d08cbd

Browse files
committed
sim: fix bug in departure pool update after launch
1 parent 2abbc5f commit 9d08cbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/sim/sim.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ func (s *Sim) spawnDepartures() {
12091209
}
12101210

12111211
// Remove it from the pool of waiting departures.
1212-
s.DeparturePool[airport] = s.DeparturePool[airport][1:]
1212+
s.DeparturePool[airport] = append(s.DeparturePool[airport][:i], s.DeparturePool[airport][i+1:]...)
12131213

12141214
// And figure out when we want to ask for the next departure.
12151215
ap := s.State.DepartureAirports[airport]
@@ -1218,6 +1218,8 @@ func (s *Sim) spawnDepartures() {
12181218
r += sumRateMap2(rates, s.LaunchConfig.DepartureRateScale)
12191219
}
12201220
s.NextDepartureLaunch[airport] = now.Add(randomWait(r, false))
1221+
1222+
break
12211223
}
12221224
}
12231225
}

0 commit comments

Comments
 (0)