summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuXarick <43006711+SamuXarick@users.noreply.github.com>2020-03-13 11:47:54 +0000
committerCharles Pigott <charlespigott@googlemail.com>2020-03-13 13:54:11 +0000
commit971201b3b7877028140863304a0e8dd63f7e4df8 (patch)
tree55133e6e9d3849f966c57dcd0903a819d1392186
parentd44a2e409c29b53db3e6c05e50d6fcce57d024de (diff)
downloadopenttd-971201b3b7877028140863304a0e8dd63f7e4df8.tar.xz
Fix: [AI/GS] CanBuildConnectedRoadPartsHere neighbours tiles were at times incorrect
-rw-r--r--src/script/api/script_road.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/script_road.cpp b/src/script/api/script_road.cpp
index f84258178..e1549b0d7 100644
--- a/src/script/api/script_road.cpp
+++ b/src/script/api/script_road.cpp
@@ -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;