Changeset - r23237:2978ae21b583
[Not reviewed]
master
0 1 0
Peter Nelson - 6 years ago 2019-01-30 09:20:07
peter1138@openttd.org
Fix #7142: Missing map bounds check when building long roads.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/road_cmd.cpp
Show inline comments
 
@@ -809,7 +809,9 @@ do_clear:;
 
 */
 
static bool CanConnectToRoad(TileIndex tile, RoadType rt, DiagDirection dir)
 
{
 
	RoadBits bits = GetAnyRoadBits(tile + TileOffsByDiagDir(dir), rt, false);
 
	tile += TileOffsByDiagDir(dir);
 
	if (!IsValidTile(tile)) return false;
 
	RoadBits bits = GetAnyRoadBits(tile, rt, false);
 
	return (bits & DiagDirToRoadBits(ReverseDiagDir(dir))) != 0;
 
}
 

	
0 comments (0 inline, 0 general)