diff --git a/core/src/com/unciv/logic/automation/BarbarianAutomation.kt b/core/src/com/unciv/logic/automation/BarbarianAutomation.kt index 1324c29931..09ff59d2f3 100644 --- a/core/src/com/unciv/logic/automation/BarbarianAutomation.kt +++ b/core/src/com/unciv/logic/automation/BarbarianAutomation.kt @@ -83,7 +83,7 @@ class BarbarianAutomation(val civInfo: CivilizationInfo) { if (unit.health < 100 && UnitAutomation().tryHealUnit(unit, unitDistanceToTiles)) return // 6 - wander - UnitAutomation.wander(unit, unitDistanceToTiles) + UnitAutomation.wander(unit) } private fun automateScout(unit: MapUnit) { @@ -111,7 +111,7 @@ class BarbarianAutomation(val civInfo: CivilizationInfo) { if (unit.health < 100 && UnitAutomation().tryHealUnit(unit, unitDistanceToTiles)) return // 5 - wander - UnitAutomation.wander(unit, unitDistanceToTiles) + UnitAutomation.wander(unit) } private fun findFurthestTileCanMoveTo( diff --git a/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt b/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt index 0b31630d22..b9c1976255 100644 --- a/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt @@ -135,7 +135,7 @@ class SpecificUnitAutomation { if (bestCityLocation == null) { // We got a badass over here, all tiles within 5 are taken? Screw it, random walk. val unitDistanceToTiles = unit.movement.getDistanceToTiles() if (UnitAutomation.tryExplore(unit, unitDistanceToTiles)) return // try to find new areas - UnitAutomation.wander(unit, unitDistanceToTiles) // go around aimlessly + UnitAutomation.wander(unit) // go around aimlessly return } diff --git a/core/src/com/unciv/logic/automation/UnitAutomation.kt b/core/src/com/unciv/logic/automation/UnitAutomation.kt index 5ad5e3e3f5..69a399a3e7 100644 --- a/core/src/com/unciv/logic/automation/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/UnitAutomation.kt @@ -44,11 +44,13 @@ class UnitAutomation { } @JvmStatic - fun wander(unit: MapUnit, unitDistanceToTiles: PathsToTilesWithinTurn) { + fun wander(unit: MapUnit) { + val unitDistanceToTiles = unit.movement.getDistanceToTiles() val reachableTiles = unitDistanceToTiles .filter { unit.movement.canMoveTo(it.key) && unit.movement.canReach(it.key) } - val reachableTilesMaxWalkingDistance = reachableTiles.filter { it.value.totalDistance == unit.currentMovement } + val reachableTilesMaxWalkingDistance = reachableTiles + .filter { it.value.totalDistance == unit.currentMovement } if (reachableTilesMaxWalkingDistance.any()) unit.movement.moveToTile(reachableTilesMaxWalkingDistance.toList().random().first) else if (reachableTiles.any()) unit.movement.moveToTile(reachableTiles.keys.random()) } @@ -171,7 +173,7 @@ class UnitAutomation { .sortedBy { it.aerialDistanceTo(unit.currentTile) } .firstOrNull { unit.movement.canReach(it) } if (reachableCityTile != null) unit.movement.headTowards(reachableCityTile) - else wander(unit, unitDistanceToTiles) + else wander(unit) return true } diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt index 72ee516afd..2af9e57576 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt @@ -200,7 +200,7 @@ class NewGameScreenOptionsTable(val newGameScreen: NewGameScreen, val updatePlay ImageGetter.setTextureRegionDrawables() } - add("Mods:".tr().toLabel(fontSize = 24)).padTop(16f).colspan(2).row() + add("Mods:".toLabel(fontSize = 24)).padTop(16f).colspan(2).row() val modCheckboxTable = Table().apply { defaults().pad(5f) } for(mod in modRulesets){ val checkBox = CheckBox(mod.name.tr(),CameraStageBaseScreen.skin) diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index 872844adbc..68bcf671a4 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -111,7 +111,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() { } diplomacyTable.add(getRelationshipTable(otherCivDiplomacyManager)).row() if (nextLevelString != "") { - diplomacyTable.add(nextLevelString.tr().toLabel()).row() + diplomacyTable.add(nextLevelString.toLabel()).row() } val friendBonusText = when (otherCiv.getCityStateType()) { diff --git a/tests/src/com/unciv/logic/map/TileInfoTests.kt b/tests/src/com/unciv/logic/map/TileInfoTests.kt index 2dbff5292b..04bd34a47b 100644 --- a/tests/src/com/unciv/logic/map/TileInfoTests.kt +++ b/tests/src/com/unciv/logic/map/TileInfoTests.kt @@ -33,6 +33,7 @@ class TileInfoTests { val terrain = improvement.terrainsCanBeBuiltOn.firstOrNull() ?: continue tile.baseTerrain = terrain tile.setTransients() + if(improvement.uniqueTo!=null) civInfo.civName = improvement.uniqueTo!! val canBeBuilt = tile.canBuildImprovement(improvement, civInfo) Assert.assertTrue( improvement.name, canBeBuilt) } diff --git a/tests/src/com/unciv/testing/TranslationTests.kt b/tests/src/com/unciv/testing/TranslationTests.kt index 99d06e6a5a..ff36dd631d 100644 --- a/tests/src/com/unciv/testing/TranslationTests.kt +++ b/tests/src/com/unciv/testing/TranslationTests.kt @@ -31,14 +31,6 @@ class TranslationTests { translations.size > 0) } - @Test - fun allUnitsHaveTranslation() { - val allUnitsHaveTranslation = allStringAreTranslated(ruleset.units.keys) - Assert.assertTrue("This test will only pass when there is a translation for all units", - allUnitsHaveTranslation) - } - - @Test fun allUnitActionsHaveTranslation() { val actions: MutableSet = HashSet() @@ -140,13 +132,6 @@ class TranslationTests { allStringsHaveTranslation) } - @Test - fun allPromotionsHaveTranslation() { - val strings: Set = ruleset.unitPromotions.keys - val allStringsHaveTranslation = allStringAreTranslated(strings) - Assert.assertTrue("This test will only pass when there is a translation for all promotions", - allStringsHaveTranslation) - } private fun allStringAreTranslated(strings: Set): Boolean { var allStringsHaveTranslation = true