mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
Cities will be called "New $name" if all city names are exhausted
This commit is contained in:
@ -87,7 +87,9 @@ class CityInfo {
|
|||||||
// Since cities can be captures between civilizations,
|
// Since cities can be captures between civilizations,
|
||||||
// we need to check which other cities exist globally and name accordingly
|
// we need to check which other cities exist globally and name accordingly
|
||||||
val allExistingCityNames = civInfo.gameInfo.civilizations.flatMap { it.cities }.map { it.name }.toHashSet()
|
val allExistingCityNames = civInfo.gameInfo.civilizations.flatMap { it.cities }.map { it.name }.toHashSet()
|
||||||
name = civInfo.getCivilization().cities.first { !allExistingCityNames.contains(it) }
|
val probablyName = civInfo.getCivilization().cities.firstOrNull { !allExistingCityNames.contains(it) }
|
||||||
|
if(probablyName!=null) name=probablyName
|
||||||
|
else name = civInfo.getCivilization().cities.first { !allExistingCityNames.contains("New $it") }
|
||||||
|
|
||||||
this.location = cityLocation
|
this.location = cityLocation
|
||||||
civInfo.cities.add(this)
|
civInfo.cities.add(this)
|
||||||
|
Reference in New Issue
Block a user