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

Method Return

src/cargopacket.cpp:596–601  ·  view source on GitHub ↗

* Returns reserved cargo to the station and removes it from the cache. * @param max_move Maximum amount of cargo to move. * @param dest Station the cargo is returned to. * @param next ID of the next station the cargo wants to go to. * @param current_tile Current tile the cargo handling is happening on. * @return Amount of cargo actually returned. */

Source from the content-addressed store, hash-verified

594 * @return Amount of cargo actually returned.
595 */
596uint VehicleCargoList::Return(uint max_move, StationCargoList *dest, StationID next, TileIndex current_tile)
597{
598 max_move = std::min(this->action_counts[MTA_LOAD], max_move);
599 this->PopCargo(CargoReturn(this, dest, max_move, next, current_tile));
600 return max_move;
601}
602
603/**
604 * Shifts cargo between two vehicles.

Callers 3

CancelReservationMethod · 0.45
operator()Method · 0.45
LoadUnloadVehicleFunction · 0.45

Calls 2

PopCargoMethod · 0.95
CargoReturnClass · 0.85

Tested by

no test coverage detected