* Returns all cargoes a vehicle can carry. * @param engine the EngineID of interest * @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask * @return bit set of CargoTypes */
| 115 | * @return bit set of CargoTypes |
| 116 | */ |
| 117 | static inline CargoTypes GetAvailableVehicleCargoTypes(EngineID engine, bool include_initial_cargo_type) |
| 118 | { |
| 119 | const Engine *e = Engine::Get(engine); |
| 120 | if (!e->CanCarryCargo()) return 0; |
| 121 | |
| 122 | CargoTypes cargoes = e->info.refit_mask; |
| 123 | |
| 124 | if (include_initial_cargo_type) { |
| 125 | SetBit(cargoes, e->GetDefaultCargoType()); |
| 126 | } |
| 127 | |
| 128 | return cargoes; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Get the capacity of the parts of a given engine. |
no test coverage detected