Changeset - r24123:6a31f9fc9b6f
[Not reviewed]
master
0 1 0
SamuXarick - 4 years ago 2020-03-13 11:47:54
43006711+SamuXarick@users.noreply.github.com
Fix: [AI/GS] CanBuildConnectedRoadPartsHere neighbours tiles were at times incorrect
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_road.cpp
Show inline comments
 
@@ -401,7 +401,7 @@ static bool NormaliseTileOffset(int32 *t
 
	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;
 

	
0 comments (0 inline, 0 general)