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.
This commit is contained in:
Xander Lenstra 2021-06-26 21:44:32 +02:00 committed by GitHub
parent 8549931360
commit 30ac1dae1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]) }
}