static */
| 30 | #include "../../safeguards.h" |
| 31 | |
| 32 | /* static */ bool ScriptVehicle::IsValidVehicle(VehicleID vehicle_id) |
| 33 | { |
| 34 | EnforceDeityOrCompanyModeValid(false); |
| 35 | const Vehicle *v = ::Vehicle::GetIfValid(vehicle_id); |
| 36 | return v != nullptr && (v->owner == ScriptObject::GetCompany() || ScriptCompanyMode::IsDeity()) && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon())); |
| 37 | } |
| 38 | |
| 39 | /* static */ bool ScriptVehicle::IsPrimaryVehicle(VehicleID vehicle_id) |
| 40 | { |
nothing calls this directly
no test coverage detected