summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYexo <Yexo@openttd.org>2009-01-29 16:14:46 +0000
committerYexo <Yexo@openttd.org>2009-01-29 16:14:46 +0000
commit6d22822faf477743ae7931fe95de51cc51b57c66 (patch)
treeed68ce9c099b5df6ea8f9e3aac89996f672dbdb9
parent19a20292069a197c873258e3ade3f0e5d61410d2 (diff)
downloadopenttd-6d22822faf477743ae7931fe95de51cc51b57c66.tar.xz
(svn r15295) -Fix [FS#2591] (r15190): Towns tried to build roads outside the map.
-rw-r--r--src/road.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/road.cpp b/src/road.cpp
index f72440fef..4680911c3 100644
--- a/src/road.cpp
+++ b/src/road.cpp
@@ -26,6 +26,7 @@ bool IsPossibleCrossing(const TileIndex tile, Axis ax)
RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
{
+ if (!IsValidTile(tile)) return ROAD_NONE;
for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) {
const TileIndex neighbor_tile = TileAddByDiagDir(tile, dir);