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

Method RemoveFromMeta

src/cargopacket.cpp:361–368  ·  view source on GitHub ↗

* Removes a packet or part of it from the metadata. * @param cp Packet to be removed. * @param action MoveToAction of the packet (for updating the counts). * @param count Amount of cargo to be removed. */

Source from the content-addressed store, hash-verified

359 * @param count Amount of cargo to be removed.
360 */
361void VehicleCargoList::RemoveFromMeta(const CargoPacket *cp, MoveToAction action, uint count)
362{
363 assert(count <= this->action_counts[action]);
364 this->AssertCountConsistency();
365 this->RemoveFromCache(cp, count);
366 this->action_counts[action] -= count;
367 this->AssertCountConsistency();
368}
369
370/**
371 * Adds a packet to the metadata.

Callers 1

operator()Method · 0.80

Calls 2

RemoveFromCacheMethod · 0.80

Tested by

no test coverage detected