MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / applyVehicleObjectLength

Function applyVehicleObjectLength

src/OpenLoco/src/Vehicles/Vehicle.cpp:1046–1058  ·  view source on GitHub ↗

0x004AE2AB head: esi

Source from the content-addressed store, hash-verified

1044 // 0x004AE2AB
1045 // head: esi
1046 void applyVehicleObjectLength(Vehicle& train)
1047 {
1048 // We want the tail to have a remaining distance of 0
1049 // so we first apply the lengths from 0 then take the return
1050 // length and set that as the negative start offset and reapply
1051
1052 const auto negStartDistance = -applyVehicleObjectLengthToBogies(train, 0);
1053 train.head->remainingDistance = negStartDistance;
1054 train.veh1->remainingDistance = negStartDistance;
1055 train.veh2->remainingDistance = negStartDistance;
1056 applyVehicleObjectLengthToBogies(train, negStartDistance);
1057 train.tail->remainingDistance = 0;
1058 }
1059
1060 Car::CarComponentIter::CarComponentIter(const CarComponent* carComponent)
1061 {

Callers 2

sub_4ADB47Method · 0.85
placeDownVehicleFunction · 0.85

Calls 1

Tested by

no test coverage detected