Remove unnecessary try catch block. (#2869)

This commit is contained in:
Alexander Korolyov 2020-07-22 05:29:12 +02:00 committed by GitHub
parent aa2f9726ac
commit 1c613ac274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -3,6 +3,7 @@ package com.unciv.logic
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.files.FileHandle
import com.badlogic.gdx.utils.Json
import com.unciv.UncivGame
import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.models.metadata.GameSettings
import com.unciv.ui.utils.ImageGetter
@ -57,11 +58,8 @@ object GameSaver {
}
fun getGeneralSettingsFile(): FileHandle {
try {
return Gdx.files.local(settingsFileName)
} catch (ex: NullPointerException) {
return FileHandle(settingsFileName)
}
return if (UncivGame.Current.consoleMode) FileHandle(settingsFileName)
else Gdx.files.local(settingsFileName)
}
fun getGeneralSettings(): GameSettings {

View File

@ -35,7 +35,10 @@ internal object ConsoleLauncher {
val game = UncivGame(consoleParameters)
UncivGame.Current = game
UncivGame.Current.settings = GameSettings().apply { showTutorials = false }
UncivGame.Current.settings = GameSettings().apply {
showTutorials = false
turnsBetweenAutosaves = 10000
}
RulesetCache.loadRulesets(true)