summaryrefslogtreecommitdiff
path: root/station_cmd.c
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
commit8d0e07378ac045b392d1c18bf0ad324e8ebe63a1 (patch)
tree6ad3ca77aaa0bff43f86b0f548cb432562734a74 /station_cmd.c
parent6935fb6455aed5a688e27cf528ee4bf3875698ae (diff)
downloadopenttd-8d0e07378ac045b392d1c18bf0ad324e8ebe63a1.tar.xz
(svn r4462) - Newstations: ensure the chosen tile layout is available from a custom station
Diffstat (limited to 'station_cmd.c')
-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)];
}
}