933 do { |
933 do { |
934 TileIndex tile = tile_org; |
934 TileIndex tile = tile_org; |
935 int w = plat_len; |
935 int w = plat_len; |
936 do { |
936 do { |
937 byte layout = *layout_ptr++; |
937 byte layout = *layout_ptr++; |
938 MakeRailStation(tile, st->owner, st->index, axis, layout, (RailType)GB(p2, 0, 4)); |
938 MakeRailStation(tile, st->owner, st->index, axis, layout & ~1, (RailType)GB(p2, 0, 4)); |
939 SetCustomStationSpecIndex(tile, specindex); |
939 SetCustomStationSpecIndex(tile, specindex); |
940 SetStationTileRandomBits(tile, GB(Random(), 0, 4)); |
940 SetStationTileRandomBits(tile, GB(Random(), 0, 4)); |
941 |
941 |
942 if (statspec != NULL) { |
942 if (statspec != NULL) { |
943 /* Use a fixed axis for GetPlatformInfo as our platforms / numtracks are always the right way around */ |
943 /* Use a fixed axis for GetPlatformInfo as our platforms / numtracks are always the right way around */ |
944 uint32 platinfo = GetPlatformInfo(AXIS_X, 0, plat_len, numtracks_orig, plat_len - w, numtracks_orig - numtracks, false); |
944 uint32 platinfo = GetPlatformInfo(AXIS_X, 0, plat_len, numtracks_orig, plat_len - w, numtracks_orig - numtracks, false); |
945 uint16 callback = GetStationCallback(CBID_STATION_TILE_LAYOUT, platinfo, 0, statspec, st, tile); |
945 uint16 callback = GetStationCallback(CBID_STATION_TILE_LAYOUT, platinfo, 0, statspec, st, tile); |
946 if (callback != CALLBACK_FAILED && callback < 8) SetStationGfx(tile, callback + axis); |
946 if (callback != CALLBACK_FAILED && callback < 8) SetStationGfx(tile, (callback & ~1) + axis); |
947 } |
947 } |
948 |
948 |
949 tile += tile_delta; |
949 tile += tile_delta; |
950 } while (--w); |
950 } while (--w); |
951 SetSignalsOnBothDir(tile_org, track); |
951 SetSignalsOnBothDir(tile_org, track); |