From 8d0e07378ac045b392d1c18bf0ad324e8ebe63a1 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 17 Apr 2006 19:26:18 +0000 Subject: [PATCH] (svn r4462) - Newstations: ensure the chosen tile layout is available from a custom station --- station_cmd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/station_cmd.c b/station_cmd.c index f68cfdecfd..a6fdad8525 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)]; } }