From 30ac1dae1c72f04a17a250337841dd9999fec9c0 Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Sat, 26 Jun 2021 21:44:32 +0200 Subject: [PATCH] Fixed crash when selecting worker (#4273) When making the changes in workers in #4252, I accidentally overlooked that Constants.workerUnique doesn't have params, and this should be the right way to write it. --- core/src/com/unciv/logic/map/MapUnit.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 3718fe474f..323bdd8b4f 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -925,7 +925,8 @@ class MapUnit { fun canBuildImprovement(improvement: TileImprovement, tile: TileInfo = currentTile): Boolean { // Constants.workerUnique deprecated since 3.15.5 - val matchingUniques = getMatchingUniques(Constants.canBuildImprovements) + getMatchingUniques(Constants.workerUnique) + if (hasUnique(Constants.workerUnique)) return true + val matchingUniques = getMatchingUniques(Constants.canBuildImprovements) return matchingUniques.any { improvement.matchesFilter(it.params[0]) || tile.matchesTerrainFilter(it.params[0]) } }