mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 22:00:24 +07:00
More concurrency problems solved
This commit is contained in:
@ -132,7 +132,7 @@ class CityExpansionManager {
|
|||||||
cityInfo.civInfo.updateDetailedCivResources()
|
cityInfo.civInfo.updateDetailedCivResources()
|
||||||
cityInfo.cityStats.update()
|
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))
|
if (!unit.civInfo.canEnterTiles(cityInfo.civInfo))
|
||||||
unit.movement.teleportToClosestMoveableTile()
|
unit.movement.teleportToClosestMoveableTile()
|
||||||
|
|
||||||
|
@ -534,8 +534,8 @@ class MapUnit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun disband() {
|
fun disband() {
|
||||||
// evacuation of transported units before disbanding, if possible
|
// 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) }) {
|
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
|
// we disbanded a carrier in a city, it can still stay in the city
|
||||||
if (currentTile.isCityCenter() && unit.movement.canMoveTo(currentTile)) continue
|
if (currentTile.isCityCenter() && unit.movement.canMoveTo(currentTile)) continue
|
||||||
// if no "fuel" to escape, should be disbanded as well
|
// if no "fuel" to escape, should be disbanded as well
|
||||||
|
Reference in New Issue
Block a user