File diff r10527:adb65148b086 → r10528:99ad5205b347
src/station.cpp
Show inline comments
 
@@ -24,24 +24,25 @@
 
#include "window_type.h"
 
#include "station_gui.h"
 
#include "zoom_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 
#include "date_func.h"
 
#include "variables.h"
 
#include "settings_type.h"
 
#include "command_func.h"
 
#include "order_func.h"
 
#include "news_func.h"
 
#include "aircraft.h"
 
#include "vehicle_gui.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
 

	
 
Station::Station(TileIndex tile)
 
{
 
	DEBUG(station, cDebugCtorLevel, "I+%3d", index);
 

	
 
	xy = tile;
 
	airport_tile = dock_tile = train_tile = INVALID_TILE;
 
	bus_stops = truck_stops = NULL;
 
	had_vehicle_of_type = 0;
 
@@ -78,24 +79,29 @@ Station::~Station()
 

	
 
	Vehicle *v;
 
	FOR_ALL_VEHICLES(v) {
 
		if (v->type == VEH_AIRCRAFT && IsNormalAircraft(v) && v->u.air.targetairport == this->index) {
 
			v->u.air.targetairport = 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);
 

	
 
	xy = INVALID_TILE;