summaryrefslogtreecommitdiff
path: root/src/station_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/station_gui.cpp')
-rw-r--r--src/station_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 6d758fdcf..6ebbfaaac 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -854,8 +854,6 @@ struct StationViewWindow : public Window {
~StationViewWindow()
{
Owner owner = Station::Get(this->window_number)->owner;
- if (!Company::IsValidID(owner)) owner = _local_company;
- if (!Company::IsValidID(owner)) return; // Spectators
DeleteWindowById(WC_TRAINS_LIST, VehicleListIdentifier(VL_STATION_LIST, VEH_TRAIN, owner, this->window_number).Pack(), false);
DeleteWindowById(WC_ROADVEH_LIST, VehicleListIdentifier(VL_STATION_LIST, VEH_ROAD, owner, this->window_number).Pack(), false);
DeleteWindowById(WC_SHIPS_LIST, VehicleListIdentifier(VL_STATION_LIST, VEH_SHIP, owner, this->window_number).Pack(), false);
@@ -1162,9 +1160,11 @@ struct StationViewWindow : public Window {
case WID_SV_TRAINS: // Show list of scheduled trains to this station
case WID_SV_ROADVEHS: // Show list of scheduled road-vehicles to this station
case WID_SV_SHIPS: // Show list of scheduled ships to this station
- case WID_SV_PLANES: // Show list of scheduled aircraft to this station
- ShowVehicleListWindow(this->owner, (VehicleType)(widget - WID_SV_TRAINS), (StationID)this->window_number);
+ case WID_SV_PLANES: { // Show list of scheduled aircraft to this station
+ Owner owner = Station::Get(this->window_number)->owner;
+ ShowVehicleListWindow(owner, (VehicleType)(widget - WID_SV_TRAINS), (StationID)this->window_number);
break;
+ }
}
}