MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsVehicleRefittable

Function IsVehicleRefittable

src/vehicle_gui.cpp:2945–2954  ·  view source on GitHub ↗

Checks whether the vehicle may be refitted at the moment.*/

Source from the content-addressed store, hash-verified

2943
2944/** Checks whether the vehicle may be refitted at the moment.*/
2945static bool IsVehicleRefittable(const Vehicle *v)
2946{
2947 if (!v->IsStoppedInDepot()) return false;
2948
2949 do {
2950 if (IsEngineRefittable(v->engine_type)) return true;
2951 } while (v->IsGroundVehicle() && (v = v->Next()) != nullptr);
2952
2953 return false;
2954}
2955
2956/** Window manager class for viewing a vehicle. */
2957struct VehicleViewWindow : Window {

Callers 1

OnPaintMethod · 0.85

Calls 4

IsEngineRefittableFunction · 0.85
IsStoppedInDepotMethod · 0.45
IsGroundVehicleMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected