From 6ab58fd8ab45b68a143beab64b91012adfebfbf3 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 6 Dec 2019 10:23:30 +0200 Subject: [PATCH] More map editor normalization, because people will doo whatever they can to break the system --- android/assets/jsons/TileImprovements.json | 1 + core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/android/assets/jsons/TileImprovements.json b/android/assets/jsons/TileImprovements.json index 32b3ebb5da..b41d716f16 100644 --- a/android/assets/jsons/TileImprovements.json +++ b/android/assets/jsons/TileImprovements.json @@ -73,6 +73,7 @@ }, { name:"Fishing Boats", + terrainsCanBeBuiltOn:["Coast"], food:1, techRequired:"Sailing", improvingTech:"Compass", diff --git a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt index 96d405ad1a..18e2f0ebbe 100644 --- a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt +++ b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt @@ -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 }