Index: rail_cmd.c
===================================================================
--- rail_cmd.c	(revision 611)
+++ rail_cmd.c	(working copy)
@@ -9,6 +9,9 @@
 #include "station.h"
 #include "sprite.h"
 
+
+extern uint16 _custom_sprites_base;
+
 void ShowTrainDepotWindow(uint tile);
 
 enum { /* These values are bitmasks for the map5 byte */
@@ -1570,8 +1573,9 @@
 				DrawTileSprites *cust = &stat->renderdata[2 + (m5 & 0x1)];
 				uint32 relocation = GetCustomStationRelocation(stat, ComposeWaypointStation(ti->tile), 0);
 
-				image = cust->ground_sprite;
-				if (image & 0x8000) image = (image & 0x7FFF) + tracktype_offs;
+				image = cust->ground_sprite & 0x7FFF;
+				image = (cust->ground_sprite >= _custom_sprites_base) ? _map3_lo[ti->tile] & 0xF
+				                                                      : tracktype_offs;
 				DrawGroundSprite(image);
 
 				foreach_draw_tile_seq(seq, cust->seq) {
