From c86d6e7b69d10af19061e5373be81f784130bfc3 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 26 Nov 2020 14:27:14 +0200 Subject: [PATCH] Fixed broken tests --- android/assets/jsons/translations/Italian.properties | 2 +- android/assets/jsons/translations/Polish.properties | 2 +- core/src/com/unciv/logic/map/TileInfo.kt | 6 +++++- core/src/com/unciv/models/ruleset/Nation.kt | 9 +++------ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/android/assets/jsons/translations/Italian.properties b/android/assets/jsons/translations/Italian.properties index ff435558a6..05817a08a8 100644 --- a/android/assets/jsons/translations/Italian.properties +++ b/android/assets/jsons/translations/Italian.properties @@ -2380,7 +2380,7 @@ What do I see before me? Another beating heart for my sacrificial fire. = Alt! C Accept this agreement or suffer the consequences. = Accetta questo scambio, o pagane le conseguenze. Welcome, friend. = Benvenuto, amico. Sacrificial Captives = Vittime sacrificali -Earn [amount]% of [param] opponent's [param2] as [stat] for kills = Ogni unità [param] nemica eliminata ti frutta [stat] pari alla sua [param2] +Earn [amount]% of [param] opponent's [param2] as [stat] for kills = Tenochtitlan = Tenochtitlan Teotihuacan = Teotihuacan Tlatelolco = Tlatelolco diff --git a/android/assets/jsons/translations/Polish.properties b/android/assets/jsons/translations/Polish.properties index 900be3fb6a..dc516b4aeb 100644 --- a/android/assets/jsons/translations/Polish.properties +++ b/android/assets/jsons/translations/Polish.properties @@ -448,7 +448,7 @@ Our proposed trade request is no longer relevant! = Nasza oferta handlowa nie je # Requires translation! Clearing a [forest] has created [amount] Production for [cityName] = [civName] assigned you a new quest: [questName]. = Cywilizacja [civName] przydzieliła Ci nowe zadanie: [questName]. -[civName] rewarded you with [influence] influence for completing the [questName] quest. = Cywilizacja [civName] nagrodziła Cie [influence] wpływu za wykonanie zadania: [questname]. +[civName] rewarded you with [influence] influence for completing the [questName] quest. = Cywilizacja [civName] nagrodziła Cie [influence] wpływu za wykonanie zadania: [questName]. The resistance in [cityName] has ended! = Opór w [cityName] dobiegł końca! # Requires translation! Our [name] took [tileDamage] tile damage and was destroyed = diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index ad4ae4e631..ba54c6b2f8 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -105,7 +105,11 @@ open class TileInfo { fun getCity(): CityInfo? = owningCity - fun getLastTerrain(): Terrain = if (terrainFeature != null) getTerrainFeature()!! else if (naturalWonder != null) getNaturalWonder() else getBaseTerrain() + fun getLastTerrain(): Terrain = when { + terrainFeature != null -> getTerrainFeature()!! + naturalWonder != null -> getNaturalWonder() + else -> getBaseTerrain() + } fun getTileResource(): TileResource = if (resource == null) throw Exception("No resource exists for this tile!") diff --git a/core/src/com/unciv/models/ruleset/Nation.kt b/core/src/com/unciv/models/ruleset/Nation.kt index 829656c4be..c050dc8df1 100644 --- a/core/src/com/unciv/models/ruleset/Nation.kt +++ b/core/src/com/unciv/models/ruleset/Nation.kt @@ -73,12 +73,9 @@ class Nation : INamed { if (innerColor == null) innerColorObject = Color.BLACK else innerColorObject = colorFromRGB(innerColor!!) - if (uniques.contains("All units move through Forest and Jungle Tiles in friendly territory as if they have roads. These tiles can be used to establish City Connections upon researching the Wheel.")) - forestsAndJunglesAreRoads = true - if (uniques.contains("Units ignore terrain costs when moving into any tile with Hills")) - ignoreHillMovementCost = true - if (uniques.contains("Units pay only 1 movement point to embark and disembark")) - embarkDisembarkCosts1 = true + forestsAndJunglesAreRoads = uniques.contains("All units move through Forest and Jungle Tiles in friendly territory as if they have roads. These tiles can be used to establish City Connections upon researching the Wheel.") + ignoreHillMovementCost = uniques.contains("Units ignore terrain costs when moving into any tile with Hills") + embarkDisembarkCosts1 = uniques.contains("Units pay only 1 movement point to embark and disembark") } lateinit var cities: ArrayList