mirror of https://github.com/OpenTTD/OpenTTD
(svn r20785) -Fix: crash when closing the station view of oilrigs (similar to r20774)
parent
dfeac6ba2e
commit
e63d975d6e
|
@ -905,6 +905,8 @@ struct StationViewWindow : public Window {
|
||||||
~StationViewWindow()
|
~StationViewWindow()
|
||||||
{
|
{
|
||||||
Owner owner = Station::Get(this->window_number)->owner;
|
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_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_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);
|
DeleteWindowById(WC_SHIPS_LIST, VehicleListIdentifier(VL_STATION_LIST, VEH_SHIP, owner, this->window_number).Pack(), false);
|
||||||
|
|
Loading…
Reference in New Issue