# HG changeset patch # User rubidium # Date 2009-01-10 14:01:17 # Node ID 4d61fce5cba80d2b4bf4e546e20b6f2a62e40dbe # Parent af72ab0998c3c4820c3eaa452008bc37487e5855 (svn r14955) -Fix: newgrf station specs didn't get deallocated when building a new station part over them. diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1099,7 +1099,11 @@ CommandCost CmdBuildRailroadStation(Tile } } + 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);