Skip to content

Commit

Permalink
Allow loading games where a buildings' "replaces" has been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Nov 27, 2024
1 parent a5a2157 commit 5e87950
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/com/unciv/logic/civilization/Civilization.kt
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,8 @@ class Civilization : IsPartOfGameInfoSerialization {
}

fun getEquivalentBuilding(baseBuilding: Building): Building {
if (baseBuilding.replaces != null)
if (baseBuilding.replaces != null
&& baseBuilding.replaces in gameInfo.ruleset.buildings)
return getEquivalentBuilding(baseBuilding.replaces!!)

for (building in cache.uniqueBuildings)
Expand Down

0 comments on commit 5e87950

Please sign in to comment.