summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-04-17 19:26:18 +0000
committerpeter1138 <peter1138@openttd.org>2006-04-17 19:26:18 +0000
commit49160bde238c479ca99065a43237b8819b1c5c26 (patch)
tree6ad3ca77aaa0bff43f86b0f548cb432562734a74
parent01cd0f6fd389a4c46dd8bace0c100f6d82540d4a (diff)
downloadopenttd-49160bde238c479ca99065a43237b8819b1c5c26.tar.xz
(svn r4462) - Newstations: ensure the chosen tile layout is available from a custom station
-rw-r--r--station_cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/station_cmd.c b/station_cmd.c
index f68cfdecf..a6fdad852 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -1942,10 +1942,12 @@ static void DrawTile_Station(TileInfo *ti)
if (statspec != NULL) {
const Station* st = GetStationByTile(ti->tile);
+ uint tile = GetStationGfx(ti->tile);
relocation = GetCustomStationRelocation(statspec, st, 0);
- //debug("Relocation %d", relocation);
- t = &statspec->renderdata[GetStationGfx(ti->tile)];
+
+ /* Ensure the chosen tile layout is valid for this custom station */
+ t = &statspec->renderdata[tile < statspec->tiles ? tile : GetRailStationAxis(ti->tile)];
}
}