changeset 3576:af50d3462294 draft

(svn r4462) - Newstations: ensure the chosen tile layout is available from a custom station
author peter1138 <peter1138@openttd.org>
date Mon, 17 Apr 2006 19:26:18 +0000
parents a81f6edbc8a7
children 4da376288678
files station_cmd.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -1942,10 +1942,12 @@
 
 		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)];
 		}
 	}