//check whether adjacent tiles are opposite local adjTile; local nextAdjTile; local adjRoadTiles2 = AITileList(); adjRoadTiles2.AddList(adjRoadTiles); for(local t = adjRoadTiles.Begin(); adjRoadTiles.HasNext(); t = adjRoadTiles.Next()) { local opposite = false; for(local i = adjRoadTiles2.Begin(); adjRoadTiles2.HasNext(); i = adjRoadTiles2.Next()) { if (t == i) { continue; } if((AIMap.GetTileX(t) == AIMap.GetTileX(i)) || (AIMap.GetTileY(t) == AIMap.GetTileY(i))) { adjTile = t; nextAdjTile = i; opposite = true; break; } } if (opposite) { break; } }