diff options
author | frosch <frosch@openttd.org> | 2012-05-16 22:08:46 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-05-16 22:08:46 +0000 |
commit | db09f6767465aebe8e90bbe8dd65aa50aafcbc94 (patch) | |
tree | 4efa361cae2e7ddc074b5c04de63b6e0b37d274b /src/vehicle_gui.cpp | |
parent | c94a2d52896964f16f3f972c115bbb687861ab1c (diff) | |
download | openttd-db09f6767465aebe8e90bbe8dd65aa50aafcbc94.tar.xz |
(svn r24260) -Change [FS#5126]: Make the oilrig-vehicle list accessible to specators and colour it's caption neutrally grey.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 81f85f534..353d710b0 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1358,7 +1358,7 @@ public: } this->FinishInitNested(desc, window_number); - this->owner = this->vli.company; + if (this->vli.company != OWNER_NONE) this->owner = this->vli.company; if (this->vli.vtype == VEH_TRAIN) ResizeWindow(this, 65, 0); } @@ -1609,7 +1609,7 @@ static WindowDesc _vehicle_list_desc( static void ShowVehicleListWindowLocal(CompanyID company, VehicleListType vlt, VehicleType vehicle_type, uint16 unique_number) { - if (!Company::IsValidID(company)) return; + if (!Company::IsValidID(company) && company != OWNER_NONE) return; _vehicle_list_desc.cls = GetWindowClassForVehicleType(vehicle_type); AllocateWindowDescFront<VehicleListWindow>(&_vehicle_list_desc, VehicleListIdentifier(vlt, vehicle_type, company, unique_number).Pack()); @@ -1636,15 +1636,7 @@ void ShowVehicleListWindow(const Vehicle *v) void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type, StationID station) { - if (!Company::IsValidID(company)) { - company = _local_company; - /* This can happen when opening the vehicle list as a spectator. */ - if (!Company::IsValidID(company)) return; - _vehicle_list_desc.flags |= WDF_CONSTRUCTION; - } else { - _vehicle_list_desc.flags &= ~WDF_CONSTRUCTION; - } - + _vehicle_list_desc.flags &= ~WDF_CONSTRUCTION; ShowVehicleListWindowLocal(company, VL_STATION_LIST, vehicle_type, station); } |