@@ -1436,26 +1436,12 @@ CommandCost CmdBuildRailStation(DoComman
DeallocateSpecFromStation(st, old_specindex);
SetCustomStationSpecIndex(tile, specindex);
SetStationTileRandomBits(tile, GB(Random(), 0, 4));
SetAnimationFrame(tile, 0);
/* Should be the same as layout but axis component could be wrong... */
StationGfx gfx = GetStationGfx(tile);
bool blocked = statspec != nullptr && HasBit(statspec->blocked, gfx);
/* Default stations do not draw pylons under roofs (gfx >= 4) */
bool pylons = statspec != nullptr ? HasBit(statspec->pylons, gfx) : gfx < 4;
bool wires = statspec == nullptr || !HasBit(statspec->wires, gfx);
SetStationTileBlocked(tile, blocked);
SetStationTileHavePylons(tile, pylons);
SetStationTileHaveWires(tile, wires);
if (!blocked) c->infrastructure.rail[rt]++;
c->infrastructure.station++;
if (statspec != nullptr) {
/* Use a fixed axis for GetPlatformInfo as our platforms / numtracks are always the right way around */
uint32_t platinfo = GetPlatformInfo(AXIS_X, GetStationGfx(tile), plat_len, numtracks_orig, plat_len - w, numtracks_orig - numtracks, false);
/* As the station is not yet completely finished, the station does not yet exist. */
uint16_t callback = GetStationCallback(CBID_STATION_TILE_LAYOUT, platinfo, 0, statspec, nullptr, tile);
@@ -1468,12 +1454,26 @@ CommandCost CmdBuildRailStation(DoComman
}
/* Trigger station animation -- after building? */
TriggerStationAnimation(st, tile, SAT_BUILT);
tile += tile_delta;
} while (--w);
AddTrackToSignalBuffer(tile_track, track, _current_company);
YapfNotifyTrackLayoutChange(tile_track, track);
tile_track += tile_delta ^ TileDiffXY(1, 1); // perpendicular to tile_delta
} while (--numtracks);
Status change: