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

Function CountVehiclesInChain

src/vehicle.cpp:674–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672}
673
674uint CountVehiclesInChain(const Vehicle *v)
675{
676 uint count = 0;
677 do count++; while ((v = v->Next()) != nullptr);
678 return count;
679}
680
681/**
682 * Check if a vehicle is counted in num_engines in each company struct

Callers 4

AdvanceWagonsBeforeSwapFunction · 0.85
AdvanceWagonsAfterSwapFunction · 0.85
ReverseTrainDirectionFunction · 0.85
FixupTrainLengthsFunction · 0.85

Calls 1

NextMethod · 0.45

Tested by

no test coverage detected