More normalization - can no longer add "everywhere" improvements on Water tiles.

This commit is contained in:
Yair Morgenstern 2019-12-06 11:17:33 +02:00
parent 6ab58fd8ab
commit c32e3fce3c

View file

@ -348,6 +348,8 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
else {
val improvement = tileInfo.getTileImprovement()!!
if(tileInfo.getBaseTerrain().impassable) tileInfo.improvement=null
if(improvement.terrainsCanBeBuiltOn.isEmpty() && tileInfo.isWater)
tileInfo.improvement=null
if (improvement.terrainsCanBeBuiltOn.isNotEmpty() // for "everywhere" improvements like city ruins, encampments, ancient ruins
&& improvement.terrainsCanBeBuiltOn.none { it == tileInfo.baseTerrain || it == tileInfo.terrainFeature })
tileInfo.improvement = null