From 2887ff30772f0e9c89493b7b12b5b20a849de6bc Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 10 Jan 2009 14:01:17 +0000 Subject: (svn r14955) -Fix: newgrf station specs didn't get deallocated when building a new station part over them. --- src/station_cmd.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/station_cmd.cpp') diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 12eca14d2..cfa23287d 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1099,7 +1099,11 @@ CommandCost CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1, } } + byte old_specindex = IsTileType(tile, MP_STATION) ? GetCustomStationSpecIndex(tile) : 0; MakeRailStation(tile, st->owner, st->index, axis, layout & ~1, (RailType)GB(p1, 0, 4)); + /* Free the spec if we overbuild something */ + DeallocateSpecFromStation(st, old_specindex); + SetCustomStationSpecIndex(tile, specindex); SetStationTileRandomBits(tile, GB(Random(), 0, 4)); SetStationAnimationFrame(tile, 0); -- cgit v1.2.3-54-g00ecf