Solved another teleportation concurrent modification exception

This commit is contained in:
Yair Morgenstern 2021-08-02 23:17:28 +03:00
parent 9ef02cb1b2
commit f773a547b3
3 changed files with 2989 additions and 2991 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -88,12 +88,10 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
if (offer.type == TradeType.City) {
val city = from.cities.first { it.id == offer.name }
city.moveToCiv(to)
city.getCenterTile().getUnits().forEach { it.movement.teleportToClosestMoveableTile() }
city.getCenterTile().getUnits().toList().forEach { it.movement.teleportToClosestMoveableTile() }
for (tile in city.getTiles()) {
for (unit in tile.getUnits().toList()) {
if (!unit.civInfo.canEnterTiles(to)) {
unit.movement.teleportToClosestMoveableTile()
}
if (!unit.civInfo.canEnterTiles(to)) unit.movement.teleportToClosestMoveableTile()
}
}
to.updateViewableTiles()