(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 e673115842
commit a363b2c317
1 changed files with 1 additions and 0 deletions

View File

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