mirror of
https://github.com/yairm210/Unciv.git
synced 2025-10-03 00:45:19 -04:00
Fix disappearing terrain when switching between mods (#7257)
This commit is contained in:
parent
83926eac7c
commit
7de3fdf452
@ -32,7 +32,7 @@ object TileSetCache : HashMap<String, TileSetConfig>() {
|
||||
for (entry in allConfigs.entries.filter { it.key.mod == mod } ) { // Built-in tilesets all have empty strings as their `.mod`, so loop through all of them.
|
||||
val tileSet = entry.key.tileSet
|
||||
if (tileSet in this) this[tileSet]!!.updateConfig(entry.value)
|
||||
else this[tileSet] = entry.value
|
||||
else this[tileSet] = entry.value.clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,18 @@ class TileSetConfig {
|
||||
var tileScale: Float = 1f
|
||||
var ruleVariants: HashMap<String, Array<String>> = HashMap()
|
||||
|
||||
fun updateConfig(other: TileSetConfig){
|
||||
fun clone(): TileSetConfig {
|
||||
val toReturn = TileSetConfig()
|
||||
toReturn.useColorAsBaseTerrain = useColorAsBaseTerrain
|
||||
toReturn.unexploredTileColor = unexploredTileColor
|
||||
toReturn.fogOfWarColor = fogOfWarColor
|
||||
toReturn.fallbackTileSet = fallbackTileSet
|
||||
toReturn.tileScale = tileScale
|
||||
toReturn.ruleVariants.putAll(ruleVariants.map { Pair(it.key, it.value.clone()) })
|
||||
return toReturn
|
||||
}
|
||||
|
||||
fun updateConfig(other: TileSetConfig) {
|
||||
useColorAsBaseTerrain = other.useColorAsBaseTerrain
|
||||
unexploredTileColor = other.unexploredTileColor
|
||||
fogOfWarColor = other.fogOfWarColor
|
||||
|
Loading…
x
Reference in New Issue
Block a user