Remove another 15% of unnecessary save file size

This commit is contained in:
yairm210
2024-08-06 19:49:08 +03:00
parent f4b76e99de
commit bcf50497ab

View File

@ -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
}