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

Method GetNextUnit

src/train.h:150–156  ·  view source on GitHub ↗

* Get the next real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist. * @return Next vehicle in the consist. */

Source from the content-addressed store, hash-verified

148 * @return Next vehicle in the consist.
149 */
150 inline Train *GetNextUnit() const
151 {
152 Train *v = this->GetNextVehicle();
153 if (v != nullptr && v->IsRearDualheaded()) v = v->GetNextVehicle();
154
155 return v;
156 }
157
158 /**
159 * Get the previous real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.

Callers 9

ReplaceChainFunction · 0.80
CmdAutoreplaceVehicleFunction · 0.80
ArrangeTrainsFunction · 0.80
NeedsServicingMethod · 0.80
GetNumWagonsMethod · 0.80
_MoveWagonInternalMethod · 0.80
_SellWagonInternalMethod · 0.80
GetWagonEngineTypeMethod · 0.80
GetWagonAgeMethod · 0.80

Calls 2

IsRearDualheadedMethod · 0.80
GetNextVehicleMethod · 0.45

Tested by

no test coverage detected