diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 8cb28a5ffd..5842e06ddb 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2205,7 +2205,7 @@ public: break; case WID_VL_MANAGE_VEHICLES_DROPDOWN: { - ShowDropDownList(this, this->BuildActionDropdownList(VehicleListIdentifier::UnPack(this->window_number).type == VL_STANDARD, false, true), 0, WID_VL_MANAGE_VEHICLES_DROPDOWN); + ShowDropDownList(this, this->BuildActionDropdownList(this->vli.type == VL_STANDARD, false, true), 0, WID_VL_MANAGE_VEHICLES_DROPDOWN); break; } diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp index 48214d9384..f4d661c1ad 100644 --- a/src/vehiclelist.cpp +++ b/src/vehiclelist.cpp @@ -32,34 +32,6 @@ uint32_t VehicleListIdentifier::Pack() const return c << 28 | this->type << 23 | this->vtype << 26 | this->index; } -/** - * Unpack a VehicleListIdentifier from a single uint32. - * @param data The data to unpack. - * @return true iff the data was valid (enough). - */ -bool VehicleListIdentifier::UnpackIfValid(uint32_t data) -{ - uint8_t c = GB(data, 28, 4); - this->company = c == 0xF ? OWNER_NONE : (CompanyID)c; - this->type = (VehicleListType)GB(data, 23, 3); - this->vtype = (VehicleType)GB(data, 26, 2); - this->index = GB(data, 0, 20); - - return this->type < VLT_END; -} - -/** - * Decode a packed vehicle list identifier into a new one. - * @param data The data to unpack. - */ -/* static */ VehicleListIdentifier VehicleListIdentifier::UnPack(uint32_t data) -{ - VehicleListIdentifier result; - [[maybe_unused]] bool ret = result.UnpackIfValid(data); - assert(ret); - return result; -} - /** Data for building a depot vehicle list. */ struct BuildDepotVehicleListData { diff --git a/src/vehiclelist.h b/src/vehiclelist.h index 037953f25d..b1c415d668 100644 --- a/src/vehiclelist.h +++ b/src/vehiclelist.h @@ -32,8 +32,6 @@ struct VehicleListIdentifier { uint32_t index; ///< A vehicle list type specific index. uint32_t Pack() const; - bool UnpackIfValid(uint32_t data); - static VehicleListIdentifier UnPack(uint32_t data); bool Valid() const { return this->type < VLT_END; }