mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 14:02:48 +07:00
Fixed scenarios crashing
This commit is contained in:
parent
16fce2bb1d
commit
ab133027cd
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 904 KiB After Width: | Height: | Size: 904 KiB |
@ -6,6 +6,7 @@ import com.badlogic.gdx.files.FileHandle
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException
|
||||
import com.badlogic.gdx.utils.JsonReader
|
||||
import com.badlogic.gdx.utils.SerializationException
|
||||
import com.unciv.Constants
|
||||
import com.unciv.UncivGame
|
||||
import com.unciv.json.fromJsonFile
|
||||
import com.unciv.json.json
|
||||
@ -327,6 +328,8 @@ class UncivFiles(
|
||||
fun loadScenario(gameFile: FileHandle): GameInfo {
|
||||
val game = loadGameFromFile(gameFile)
|
||||
game.civilizations.removeAll { it.isSpectator() }
|
||||
for (civ in game.civilizations)
|
||||
civ.diplomacy.remove(Constants.spectator)
|
||||
if (game.civilizations.none { it.isHuman() })
|
||||
game.civilizations.first { it.isMajorCiv() }.playerType = PlayerType.Human
|
||||
|
||||
|
@ -25,7 +25,7 @@ class ScenarioScreen: PickerScreen() {
|
||||
scenarioToLoad = file
|
||||
rightSideButton.setText(file.name())
|
||||
rightSideButton.enable()
|
||||
})
|
||||
}).row()
|
||||
}
|
||||
} catch (ex: Exception) { } // invalid, couldn't even load preview, probably invalid json
|
||||
}
|
||||
|
@ -1204,6 +1204,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
??? example "Can hurry technology research"
|
||||
Applicable to: Unit
|
||||
|
||||
??? example "Can generate a large amount of culture"
|
||||
Applicable to: Unit
|
||||
|
||||
??? example "Can undertake a trade mission with City-State, giving a large sum of gold and [amount] Influence"
|
||||
Example: "Can undertake a trade mission with City-State, giving a large sum of gold and [3] Influence"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user