(svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts.

This commit is contained in:
fonsinchen
2014-05-11 12:49:51 +00:00
parent 726e1b6920
commit 1dc630ff26

View File

@@ -359,6 +359,7 @@ void VehicleCargoList::AddToCache(const CargoPacket *cp)
*/ */
void VehicleCargoList::RemoveFromMeta(const CargoPacket *cp, MoveToAction action, uint count) void VehicleCargoList::RemoveFromMeta(const CargoPacket *cp, MoveToAction action, uint count)
{ {
assert(count <= this->action_counts[action]);
this->AssertCountConsistency(); this->AssertCountConsistency();
this->RemoveFromCache(cp, count); this->RemoveFromCache(cp, count);
this->action_counts[action] -= count; this->action_counts[action] -= count;