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

Method GetFirstEnginePart

src/vehicle_base.h:951–956  ·  view source on GitHub ↗

* Get the first part of an articulated engine. * @return First part of the engine. */

Source from the content-addressed store, hash-verified

949 * @return First part of the engine.
950 */
951 inline Vehicle *GetFirstEnginePart()
952 {
953 Vehicle *v = this;
954 while (v->IsArticulatedPart()) v = v->Previous();
955 return v;
956 }
957
958 /**
959 * Get the first part of an articulated engine.

Callers 6

CmdMoveRailVehicleFunction · 0.45
CmdSellRailWagonFunction · 0.45
GetVehicleSetFunction · 0.45
HandleStationRefitFunction · 0.45
GetBestFittingSubTypeFunction · 0.45

Calls 2

IsArticulatedPartMethod · 0.80
PreviousMethod · 0.45

Tested by

no test coverage detected