mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 12:48:56 +07:00
Remove another 15% of unnecessary save file size
This commit is contained in:
@ -428,7 +428,15 @@ class UncivFiles(
|
||||
game.version = GameInfo.CURRENT_COMPATIBILITY_VERSION
|
||||
|
||||
if (updateChecksum) game.checksum = game.calculateChecksum()
|
||||
val plainJson = json().toJson(game)
|
||||
var plainJson = json().toJson(game)
|
||||
|
||||
val removeableStrings = listOf(
|
||||
",\"history\":{}", // empty history object in tile
|
||||
",\"promotions\":{}", // empty promotions object in unit
|
||||
)
|
||||
for (removableString in removeableStrings)
|
||||
plainJson = plainJson.replace(removableString,"")
|
||||
|
||||
return if (forceZip ?: saveZipped) Gzip.zip(plainJson) else plainJson
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user