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

Method TryMerge

src/cargopacket.cpp:223–232  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

221 */
222template <class Tinst, class Tcont>
223/* static */ bool CargoList<Tinst, Tcont>::TryMerge(CargoPacket *icp, CargoPacket *cp)
224{
225 if (Tinst::AreMergable(icp, cp) &&
226 icp->count + cp->count <= CargoPacket::MAX_COUNT) {
227 icp->Merge(cp);
228 return true;
229 } else {
230 return false;
231 }
232}
233
234/*
235 *

Callers

nothing calls this directly

Calls 1

MergeMethod · 0.45

Tested by

no test coverage detected