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

Method Reroute

src/cargopacket.cpp:663–668  ·  view source on GitHub ↗

* Routes packets with station "avoid" as next hop to a different place. * @param max_move Maximum amount of cargo to move. * @param dest List to prepend the cargo to. * @param avoid Station to exclude from routing and current next hop of packets to reroute. * @param avoid2 Additional station to exclude from routing. * @param ge GoodsEntry to get the routing info from. */

Source from the content-addressed store, hash-verified

661 * @param ge GoodsEntry to get the routing info from.
662 */
663uint VehicleCargoList::Reroute(uint max_move, VehicleCargoList *dest, StationID avoid, StationID avoid2, const GoodsEntry *ge)
664{
665 max_move = std::min(this->action_counts[MTA_TRANSFER], max_move);
666 this->ShiftCargo(VehicleCargoReroute(this, dest, max_move, avoid, avoid2, ge));
667 return max_move;
668}
669
670/*
671 *

Callers 1

RerouteCargoFunction · 0.80

Calls 3

ShiftCargoMethod · 0.95
VehicleCargoRerouteClass · 0.85
StationCargoRerouteClass · 0.85

Tested by

no test coverage detected