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

Method Reserve

src/cargopacket.cpp:817–820  ·  view source on GitHub ↗

* Reserves cargo for loading onto the vehicle. * @param max_move Maximum amount of cargo to reserve. * @param dest VehicleCargoList to reserve for. * @param next_station Next station(s) the loading vehicle will visit. * @param current_tile Current tile the cargo handling is happening on. * @return Amount of cargo actually reserved. */

Source from the content-addressed store, hash-verified

815 * @return Amount of cargo actually reserved.
816 */
817uint StationCargoList::Reserve(uint max_move, VehicleCargoList *dest, std::span<const StationID> next_station, TileIndex current_tile)
818{
819 return this->ShiftCargo(CargoReservation(this, dest, max_move, current_tile), next_station, true);
820}
821
822/**
823 * Loads cargo onto a vehicle. If the vehicle has reserved cargo load that.

Callers 2

operator()Method · 0.45
operator()Method · 0.45

Calls 2

CargoReservationClass · 0.85
ShiftCargoMethod · 0.80

Tested by

no test coverage detected