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

Method Preprocess

src/cargoaction.cpp:24–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 */
23template <class Tsource, class Tdest>
24CargoPacket *CargoMovement<Tsource, Tdest>::Preprocess(CargoPacket *cp)
25{
26 if (this->max_move < cp->Count()) {
27 cp = cp->Split(this->max_move);
28 this->max_move = 0;
29 } else {
30 this->max_move -= cp->Count();
31 }
32 return cp;
33}
34
35/**
36 * Determines the amount of cargo to be removed from a packet and removes that

Callers 1

operator()Method · 0.80

Calls 2

SplitMethod · 0.80
CountMethod · 0.45

Tested by

no test coverage detected