mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-05 15:59:50 +07:00
Some tile still has owner after city has been razed. (#8252)
* resolve: the tile still has owner after city has been razed. * working city null check. * avoid concurrent modification.
This commit is contained in:
@ -1002,7 +1002,11 @@ class CivilizationInfo : IsPartOfGameInfoSerialization {
|
||||
|
||||
if (isMajorCiv()) greatPeople.addGreatPersonPoints(getGreatPersonPointsForNextTurn()) // City-states don't get great people!
|
||||
|
||||
for (city in cities.toList()) { // a city can be removed while iterating (if it's being razed) so we need to iterate over a copy
|
||||
// To handle tile's owner issue (#8246), we need to run being razed city first.
|
||||
for (city in sequence {
|
||||
yieldAll(cities.filter { it.isBeingRazed })
|
||||
yieldAll(cities.filterNot { it.isBeingRazed })
|
||||
}.toList()) { // a city can be removed while iterating (if it's being razed) so we need to iterate over a copy
|
||||
city.endTurn()
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ class CityScreenTileTable(private val cityScreen: CityScreen): Table() {
|
||||
if (selectedTile.owningCity != null)
|
||||
innerTable.add("Owned by [${selectedTile.owningCity!!.name}]".toLabel()).row()
|
||||
|
||||
if (city.civInfo.cities.filterNot { it == city }.any { it.isWorked(selectedTile) })
|
||||
if (selectedTile.getWorkingCity() != null)
|
||||
innerTable.add("Worked by [${selectedTile.getWorkingCity()!!.name}]".toLabel()).row()
|
||||
|
||||
if (city.isWorked(selectedTile)) {
|
||||
|
Reference in New Issue
Block a user