mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Fixed relatively rare crash where the settings were being read but ended up null, not sure how that happened to start with...
This commit is contained in:
parent
31b4680b5f
commit
314b620405
@ -48,7 +48,10 @@ class GameSaver {
|
|||||||
fun getGeneralSettings(): GameSettings {
|
fun getGeneralSettings(): GameSettings {
|
||||||
val settingsFile = getGeneralSettingsFile()
|
val settingsFile = getGeneralSettingsFile()
|
||||||
if(!settingsFile.exists()) return GameSettings()
|
if(!settingsFile.exists()) return GameSettings()
|
||||||
val settings = json().fromJson(GameSettings::class.java, settingsFile)
|
var settings = json().fromJson(GameSettings::class.java, settingsFile)
|
||||||
|
// I'm not sure of the circumstances,
|
||||||
|
// but some people were getting null settings, even though the file existed??? Very odd.
|
||||||
|
if(settings==null) settings = GameSettings()
|
||||||
|
|
||||||
val currentTileSets = ImageGetter.atlas.regions.asSequence()
|
val currentTileSets = ImageGetter.atlas.regions.asSequence()
|
||||||
.filter { it.name.startsWith("TileSets") }
|
.filter { it.name.startsWith("TileSets") }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user