Skip to content

Commit

Permalink
Oops
Browse files Browse the repository at this point in the history
  • Loading branch information
Bombbird2001 committed Aug 18, 2021
1 parent 881678c commit 057f2e9
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,30 @@ class RunwayManager(private val airport: Airport) {
for (runway: Runway in airport.landingRunways.values) {
if (MathTools.componentInDirection(windSpd, windHdg, runway.heading) < -5) return true
}
if (!this::latestRunwayConfig.isInitialized) return true
if (!this::latestRunwayConfig.isInitialized) {
//Search for config
var found = false
for (config in dayConfigs) {
if (config.landingRunwayMap.keys == airport.landingRunways.keys && config.takeoffRunwayMap.keys == airport.takeoffRunways.keys) {
found = true
latestRunwayConfig = config
break
}
}
if (!found) {
for (config in nightConfigs) {
if (config.landingRunwayMap.keys == airport.landingRunways.keys && config.takeoffRunwayMap.keys == airport.takeoffRunways.keys) {
found = true
latestRunwayConfig = config
break
}
}
if (!found) {
Gdx.app.log("Runway manager", "Could not find current runway config in all configs! Runway change initialized")
return true
}
}
}
return !availableConfigs.contains(latestRunwayConfig, false) //Even if current config works, if config time no longer applies, needs to be changed also
}

Expand Down

0 comments on commit 057f2e9

Please sign in to comment.