(svn r4462) - Newstations: ensure the chosen tile layout is available from a custom station
authorpeter1138
Mon, 17 Apr 2006 19:26:18 +0000
changeset 3576 007e6b163bf5
parent 3575 867df1ec208a
child 3577 9e345c932ba2
(svn r4462) - Newstations: ensure the chosen tile layout is available from a custom station
station_cmd.c
--- a/station_cmd.c	Mon Apr 17 19:09:30 2006 +0000
+++ b/station_cmd.c	Mon Apr 17 19:26:18 2006 +0000
@@ -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)];
 		}
 	}