mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 05:09:25 +07:00
More concurrency problems solved
This commit is contained in:
@ -132,7 +132,7 @@ class CityExpansionManager {
|
||||
cityInfo.civInfo.updateDetailedCivResources()
|
||||
cityInfo.cityStats.update()
|
||||
|
||||
for (unit in tileInfo.getUnits())
|
||||
for (unit in tileInfo.getUnits().toList()) // tolisted because we're modifying
|
||||
if (!unit.civInfo.canEnterTiles(cityInfo.civInfo))
|
||||
unit.movement.teleportToClosestMoveableTile()
|
||||
|
||||
|
@ -534,8 +534,8 @@ class MapUnit {
|
||||
}
|
||||
|
||||
fun disband() {
|
||||
// evacuation of transported units before disbanding, if possible
|
||||
for (unit in currentTile.getUnits().filter { it.isTransported && isTransportTypeOf(it) }) {
|
||||
// evacuation of transported units before disbanding, if possible. toListed because we're modifying the unit list.
|
||||
for (unit in currentTile.getUnits().filter { it.isTransported && isTransportTypeOf(it) }.toList()) {
|
||||
// we disbanded a carrier in a city, it can still stay in the city
|
||||
if (currentTile.isCityCenter() && unit.movement.canMoveTo(currentTile)) continue
|
||||
// if no "fuel" to escape, should be disbanded as well
|
||||
|
Reference in New Issue
Block a user