local closestTownscopy = AIList();
for (local town = closestTowns.Begin(); closestTowns.HasNext(); town = closestTowns.Next()) {
local closest_town = AITile.GetClosestTown(tile);
if (closestTowns.HasItem(closest_town) {
closestTownscopy.AddItem(town);
}
}
closestTowns.Clear();
closestTowns.AddList(closestTownscopy);