summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-06-12 20:47:45 +0000
committerterkhen <terkhen@openttd.org>2011-06-12 20:47:45 +0000
commit00e5c1df18449992cc974b99c61a44d1385bf4a7 (patch)
tree7433db92049848236fe05f18b99d6f80c99442c6 /src/station_cmd.cpp
parent9f55abf51aac0f408e60d905fb2ac1b8a1405bb9 (diff)
downloadopenttd-00e5c1df18449992cc974b99c61a44d1385bf4a7.tar.xz
(svn r22567) -Codechange: Store persistent storages inside a pool.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 8094b805d..54f619fd8 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2191,7 +2191,6 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
st->airport.layout = layout;
st->airport.flags = 0;
st->airport.rotation = rotation;
- st->airport.psa.ResetToZero();
st->rect.BeforeAddRect(tile, w, h, StationRect::ADD_TRY);
@@ -2271,6 +2270,9 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
}
if (flags & DC_EXEC) {
+ /* Clear the persistent storage. */
+ delete st->airport.psa;
+
const AirportSpec *as = st->airport.GetSpec();
for (uint i = 0; i < st->airport.GetNumHangars(); ++i) {
DeleteWindowById(
@@ -2288,7 +2290,6 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
st->airport.Clear();
st->facilities &= ~FACIL_AIRPORT;
- st->airport.psa.ResetToZero();
SetWindowWidgetDirty(WC_STATION_VIEW, st->index, SVW_PLANES);