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

Method Shift

src/cargopacket.cpp:609–614  ·  view source on GitHub ↗

* Shifts cargo between two vehicles. * @param dest Other vehicle's cargo list. * @param max_move Maximum amount of cargo to be moved. * @return Amount of cargo actually moved. */

Source from the content-addressed store, hash-verified

607 * @return Amount of cargo actually moved.
608 */
609uint VehicleCargoList::Shift(uint max_move, VehicleCargoList *dest)
610{
611 max_move = std::min(this->count, max_move);
612 this->PopCargo(CargoShift(this, dest, max_move));
613 return max_move;
614}
615
616/**
617 * Unloads cargo at the given station. Deliver or transfer, depending on the

Callers 2

CheckCargoCapacityFunction · 0.45
TransferCargoFunction · 0.45

Calls 2

PopCargoMethod · 0.95
CargoShiftClass · 0.85

Tested by

no test coverage detected