summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2010-06-11 00:18:28 +0000
committersmatz <smatz@openttd.org>2010-06-11 00:18:28 +0000
commitc4175b752a11b3b8c0c2d6b6677493f942b11fb8 (patch)
treebaf7ed0749d967050706ed43dd709c99ea4d93fc /src/station.cpp
parent8bf4a7d1ae5643b20d842f7fe9637e453614b8aa (diff)
downloadopenttd-c4175b752a11b3b8c0c2d6b6677493f942b11fb8.tar.xz
(svn r19957) -Codechange: remove VLW_WAYPOINT_LIST
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/station.cpp b/src/station.cpp
index b25f48a3f..47389d79c 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -35,6 +35,16 @@ BaseStation::~BaseStation()
{
free(this->name);
free(this->speclist);
+
+ if (CleaningPool()) return;
+
+ Owner owner = this->owner;
+ if (!Company::IsValidID(owner)) owner = _local_company;
+ WindowNumber wno = (this->index << 16) | VLW_STATION_LIST | owner;
+ DeleteWindowById(WC_TRAINS_LIST, wno | (VEH_TRAIN << 11));
+ DeleteWindowById(WC_ROADVEH_LIST, wno | (VEH_ROAD << 11));
+ DeleteWindowById(WC_SHIPS_LIST, wno | (VEH_SHIP << 11));
+ DeleteWindowById(WC_AIRCRAFT_LIST, wno | (VEH_AIRCRAFT << 11));
}
Station::Station(TileIndex tile) :
@@ -83,14 +93,6 @@ Station::~Station()
DeleteWindowById(WC_STATION_VIEW, index);
- Owner owner = this->owner;
- if (!Company::IsValidID(owner)) owner = _local_company;
- WindowNumber wno = (this->index << 16) | VLW_STATION_LIST | owner;
- DeleteWindowById(WC_TRAINS_LIST, wno | (VEH_TRAIN << 11));
- DeleteWindowById(WC_ROADVEH_LIST, wno | (VEH_ROAD << 11));
- DeleteWindowById(WC_SHIPS_LIST, wno | (VEH_SHIP << 11));
- DeleteWindowById(WC_AIRCRAFT_LIST, wno | (VEH_AIRCRAFT << 11));
-
/* Now delete all orders that go to the station */
RemoveOrderFromAllVehicles(OT_GOTO_STATION, this->index);