From c4175b752a11b3b8c0c2d6b6677493f942b11fb8 Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 11 Jun 2010 00:18:28 +0000 Subject: (svn r19957) -Codechange: remove VLW_WAYPOINT_LIST --- src/station.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/station.cpp') 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); -- cgit v1.2.3-54-g00ecf