static */
| 51 | } |
| 52 | |
| 53 | /* static */ SQInteger ScriptVehicle::GetNumWagons(VehicleID vehicle_id) |
| 54 | { |
| 55 | if (!IsValidVehicle(vehicle_id)) return -1; |
| 56 | |
| 57 | int num = 1; |
| 58 | |
| 59 | const Train *v = ::Train::GetIfValid(vehicle_id); |
| 60 | if (v != nullptr) { |
| 61 | while ((v = v->GetNextUnit()) != nullptr) num++; |
| 62 | } |
| 63 | |
| 64 | return num; |
| 65 | } |
| 66 | |
| 67 | /* static */ SQInteger ScriptVehicle::GetLength(VehicleID vehicle_id) |
| 68 | { |
nothing calls this directly
no test coverage detected