mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-13 07:10:57 +00:00
(svn r15187) -Fix: assert when an AI called AIRoad::GetNeighbourRoadCount on a tile at the north edge (bug found by SmatZ).
This commit is contained in:
parent
9fd38d1022
commit
dcdb771c40
@ -422,10 +422,10 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
|
|||||||
::RoadTypes rts = ::RoadTypeToRoadTypes((::RoadType)GetCurrentRoadType());
|
::RoadTypes rts = ::RoadTypeToRoadTypes((::RoadType)GetCurrentRoadType());
|
||||||
int32 neighbour = 0;
|
int32 neighbour = 0;
|
||||||
|
|
||||||
if (NeighbourHasReachableRoad(rts, tile, DIAGDIR_NE)) neighbour++;
|
if (TileX(tile) > 0 && NeighbourHasReachableRoad(rts, tile, DIAGDIR_NE)) neighbour++;
|
||||||
if (NeighbourHasReachableRoad(rts, tile, DIAGDIR_SE)) neighbour++;
|
if (NeighbourHasReachableRoad(rts, tile, DIAGDIR_SE)) neighbour++;
|
||||||
if (NeighbourHasReachableRoad(rts, tile, DIAGDIR_SW)) neighbour++;
|
if (NeighbourHasReachableRoad(rts, tile, DIAGDIR_SW)) neighbour++;
|
||||||
if (NeighbourHasReachableRoad(rts, tile, DIAGDIR_NW)) neighbour++;
|
if (TileY(tile) > 0 && NeighbourHasReachableRoad(rts, tile, DIAGDIR_NW)) neighbour++;
|
||||||
|
|
||||||
return neighbour;
|
return neighbour;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user