static */
| 426 | } |
| 427 | |
| 428 | /* static */ SQInteger ScriptVehicle::GetCargoLoad(VehicleID vehicle_id, CargoType cargo) |
| 429 | { |
| 430 | if (!IsValidVehicle(vehicle_id)) return -1; |
| 431 | if (!ScriptCargo::IsValidCargo(cargo)) return -1; |
| 432 | |
| 433 | uint32_t amount = 0; |
| 434 | for (const Vehicle *v = ::Vehicle::Get(vehicle_id); v != nullptr; v = v->Next()) { |
| 435 | if (v->cargo_type == cargo) amount += v->cargo.StoredCount(); |
| 436 | } |
| 437 | |
| 438 | return amount; |
| 439 | } |
| 440 | |
| 441 | /* static */ GroupID ScriptVehicle::GetGroupID(VehicleID vehicle_id) |
| 442 | { |
nothing calls this directly
no test coverage detected