More map editor normalization, because people will doo whatever they can to break the system

This commit is contained in:
Yair Morgenstern 2019-12-06 10:23:30 +02:00
parent 3ea4f8bc82
commit 6ab58fd8ab
2 changed files with 4 additions and 0 deletions

View file

@ -73,6 +73,7 @@
},
{
name:"Fishing Boats",
terrainsCanBeBuiltOn:["Coast"],
food:1,
techRequired:"Sailing",
improvingTech:"Compass",

View file

@ -347,11 +347,14 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
}
else {
val improvement = tileInfo.getTileImprovement()!!
if(tileInfo.getBaseTerrain().impassable) 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
}
}
if(tileInfo.getBaseTerrain().impassable || tileInfo.isWater)
tileInfo.roadStatus=RoadStatus.None
}