Fix: [AI/GS] CanBuildConnectedRoadPartsHere neighbours tiles were at times incorrect

This commit is contained in:
SamuXarick 2020-03-13 11:47:54 +00:00 committed by Charles Pigott
parent d44a2e409c
commit 971201b3b7
1 changed files with 1 additions and 1 deletions

View File

@ -401,7 +401,7 @@ static bool NormaliseTileOffset(int32 *tile)
if (::DistanceManhattan(tile, start) != 1 || ::DistanceManhattan(tile, end) != 1) return -1;
/* ROAD_NW ROAD_SW ROAD_SE ROAD_NE */
static const TileIndexDiff neighbours[] = {::TileDiffXY(0, -1), ::TileDiffXY(1, 0), ::TileDiffXY(0, 1), ::TileDiffXY(-1, 0)};
const TileIndexDiff neighbours[] = {::TileDiffXY(0, -1), ::TileDiffXY(1, 0), ::TileDiffXY(0, 1), ::TileDiffXY(-1, 0)};
Array *existing = (Array*)alloca(sizeof(Array) + lengthof(neighbours) * sizeof(int32));
existing->size = 0;