Skip to content

Commit 4a0a551

Browse files
committed
Resolved #14574 - Removing improvement-creating buildings where the improvement is not in any tile in the city, no longer crashes
1 parent 63b1a3e commit 4a0a551

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/com/unciv/logic/city/CityConstructions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,8 @@ class CityConstructions : IsPartOfGameInfoSerialization {
664664

665665
if (building.hasCreateOneImprovementUnique()){
666666
val improvement = building.getImprovementToCreate(city.getRuleset(), city.civ)!!
667-
val tileWithImprovementToRemove = city.getTiles().first { it.improvement == improvement.name }
668-
tileWithImprovementToRemove.removeImprovement()
667+
val tileWithImprovementToRemove = city.getTiles().firstOrNull { it.improvement == improvement.name }
668+
tileWithImprovementToRemove?.removeImprovement()
669669
}
670670

671671
updateUniques()

0 commit comments

Comments
 (0)