mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-12 03:48:16 +07:00
Better checking for unloadable scenarios
This commit is contained in:
parent
6662944f32
commit
9b3dd5058f
@ -304,9 +304,9 @@ class MapUnit {
|
||||
updateUniques()
|
||||
}
|
||||
|
||||
fun useMovementPoints(amount:Float){
|
||||
fun useMovementPoints(amount:Float) {
|
||||
currentMovement -= amount
|
||||
if(currentMovement<0) currentMovement = 0f
|
||||
if (currentMovement < 0) currentMovement = 0f
|
||||
}
|
||||
|
||||
fun doAction() {
|
||||
|
@ -80,10 +80,11 @@ class MapOptionsTable(val newGameScreen: NewGameScreen): Table() {
|
||||
if (scenarioFiles.any()) {
|
||||
for (savedGame in getScenarioFiles()) {
|
||||
try { // Sometimes, we have scenarios that are dependent on mods that we don't have and so they can't be loaded.
|
||||
selectSavedGameAsScenario(savedGame)
|
||||
GameSaver.loadGameFromFile(savedGame)
|
||||
scenarioSelectBox.items.add(FileHandleWrapper(savedGame))
|
||||
} catch (ex: Exception) {}
|
||||
}
|
||||
|
||||
scenarioSelectBox.items = scenarioSelectBox.items // it doesn't register them until you do this.
|
||||
scenarioSelectBox.selected = scenarioSelectBox.items.first()
|
||||
// needs to be after the item change, so it doesn't activate before we choose the Scenario maptype
|
||||
|
Loading…
Reference in New Issue
Block a user