mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 15:59:33 +07:00
Fixed scenarios crashing
This commit is contained in:
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.GdxRuntimeException
|
||||||
import com.badlogic.gdx.utils.JsonReader
|
import com.badlogic.gdx.utils.JsonReader
|
||||||
import com.badlogic.gdx.utils.SerializationException
|
import com.badlogic.gdx.utils.SerializationException
|
||||||
|
import com.unciv.Constants
|
||||||
import com.unciv.UncivGame
|
import com.unciv.UncivGame
|
||||||
import com.unciv.json.fromJsonFile
|
import com.unciv.json.fromJsonFile
|
||||||
import com.unciv.json.json
|
import com.unciv.json.json
|
||||||
@ -327,6 +328,8 @@ class UncivFiles(
|
|||||||
fun loadScenario(gameFile: FileHandle): GameInfo {
|
fun loadScenario(gameFile: FileHandle): GameInfo {
|
||||||
val game = loadGameFromFile(gameFile)
|
val game = loadGameFromFile(gameFile)
|
||||||
game.civilizations.removeAll { it.isSpectator() }
|
game.civilizations.removeAll { it.isSpectator() }
|
||||||
|
for (civ in game.civilizations)
|
||||||
|
civ.diplomacy.remove(Constants.spectator)
|
||||||
if (game.civilizations.none { it.isHuman() })
|
if (game.civilizations.none { it.isHuman() })
|
||||||
game.civilizations.first { it.isMajorCiv() }.playerType = PlayerType.Human
|
game.civilizations.first { it.isMajorCiv() }.playerType = PlayerType.Human
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class ScenarioScreen: PickerScreen() {
|
|||||||
scenarioToLoad = file
|
scenarioToLoad = file
|
||||||
rightSideButton.setText(file.name())
|
rightSideButton.setText(file.name())
|
||||||
rightSideButton.enable()
|
rightSideButton.enable()
|
||||||
})
|
}).row()
|
||||||
}
|
}
|
||||||
} catch (ex: Exception) { } // invalid, couldn't even load preview, probably invalid json
|
} 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"
|
??? example "Can hurry technology research"
|
||||||
Applicable to: Unit
|
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 [amount] Influence"
|
||||||
Example: "Can undertake a trade mission with City-State, giving a large sum of gold and [3] Influence"
|
Example: "Can undertake a trade mission with City-State, giving a large sum of gold and [3] Influence"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user