* Find first cargo label that exists and is active from a list of cargo labels. * @param labels List of cargo labels. * @returns First cargo label in list that exists, or CT_INVALID if none exist. */
| 610 | * @returns First cargo label in list that exists, or CT_INVALID if none exist. |
| 611 | */ |
| 612 | static CargoLabel GetActiveCargoLabel(const std::initializer_list<CargoLabel> &labels) |
| 613 | { |
| 614 | for (const CargoLabel &label : labels) { |
| 615 | CargoType cargo_type = GetCargoTypeByLabel(label); |
| 616 | if (cargo_type != INVALID_CARGO) return label; |
| 617 | } |
| 618 | return CT_INVALID; |
| 619 | } |
| 620 | |
| 621 | /** |
| 622 | * Get active cargo label from either a cargo label or climate-dependent mixed cargo type. |
no test coverage detected