Skip to content

Commit

Permalink
Fix aircraft min max optimal speed not getting updated on route statu…
Browse files Browse the repository at this point in the history
…s change causing occasional weird speed behaviour, hide last played time if parsing failed
  • Loading branch information
Bombbird2001 committed Jun 1, 2024
1 parent ad1bafd commit 136f03d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ktx.collections.*
import ktx.scene2d.*
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeParseException

/** Screen for searching game saves in the user app data */
class LoadGame: BasicUIScreen() {
Expand Down Expand Up @@ -241,8 +242,12 @@ class LoadGame: BasicUIScreen() {
val defaultDetails = "${meta.mainName} - Score: ${meta.score} High score: ${meta.highScore}\nLanded: ${meta.landed} Departed: ${meta.departed}"
val configDetails = meta.configNames ?: ""
val lastPlayedString = meta.lastPlayedDatetime?.let {
val playedTemporal = ZonedDateTime.parse(it, DateTimeFormatter.ISO_ZONED_DATE_TIME)
getDatetimeDifferenceString(playedTemporal, ZonedDateTime.now())
try {
val playedTemporal = ZonedDateTime.parse(it, DateTimeFormatter.ISO_ZONED_DATE_TIME)
getDatetimeDifferenceString(playedTemporal, ZonedDateTime.now())
} catch (e: DateTimeParseException) {
null
}
}
val lastPlayed = if (lastPlayedString != null) "\nLast played: $lastPlayedString" else ""
val saveButton = textButton(defaultDetails, "NewLoadGameAirport").cell(growX = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,11 @@ class AISystem: EntitySystem() {
return@apply
}
}

val spds = getMinMaxOptimalIAS(entity)
actingClearance.minIas = spds.first
actingClearance.maxIas = spds.second
actingClearance.optimalIas = spds.third
}

/**
Expand Down

0 comments on commit 136f03d

Please sign in to comment.