Changeset - r12064:dab8b4af4fd5
[Not reviewed]
master
0 1 0
smatz - 15 years ago 2009-05-31 09:34:40
smatz@openttd.org
(svn r16476) -Fix (r16475): wrong version of the patch
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/station.cpp
Show inline comments
 
@@ -57,49 +57,49 @@ Station::Station(TileIndex tile)
 
 * is OT_GOTO_DEPOT.
 
 */
 
Station::~Station()
 
{
 
	DEBUG(station, cDebugCtorLevel, "I-%3d", index);
 

	
 
	free(this->name);
 
	free(this->speclist);
 

	
 
	if (CleaningPool()) return;
 

	
 
	while (!loading_vehicles.empty()) {
 
		loading_vehicles.front()->LeaveStation();
 
	}
 

	
 
	Aircraft *a;
 
	FOR_ALL_AIRCRAFT(a) {
 
		if (!IsNormalAircraft(a)) continue;
 
		if (a->targetairport == this->index) a->targetairport = INVALID_STATION;
 
	}
 

	
 
	Vehicle *v;
 
	FOR_ALL_VEHICLES(v) {
 
		/* Forget about this station if this station is removed */
 
		if (v->last_station_visited == destination && type == OT_GOTO_STATION) {
 
		if (v->last_station_visited == this->index) {
 
			v->last_station_visited = INVALID_STATION;
 
		}
 
	}
 

	
 
	MarkDirty();
 
	InvalidateWindowData(WC_STATION_LIST, this->owner, 0);
 

	
 
	DeleteWindowById(WC_STATION_VIEW, index);
 
	WindowNumber wno = (index << 16) | VLW_STATION_LIST | this->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, index);
 

	
 
	/* Subsidies need removal as well */
 
	DeleteSubsidyWithStation(index);
 

	
 
	/* Remove all news items */
 
	DeleteStationNews(this->index);
 

	
 
	InvalidateWindowData(WC_SELECT_STATION, 0, 0);
0 comments (0 inline, 0 general)