Fixed #2492 - trading cities with units in them no longer crashes the game

This commit is contained in:
Yair Morgenstern
2020-04-23 19:53:06 +03:00
parent 4e53bb77d1
commit 07b4dcd8ba

View File

@ -97,7 +97,7 @@ 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() }
to.updateViewableTiles()
from.updateViewableTiles()
}