From 1dc630ff26fc15b4e1165e78bd40084fc7bb3b49 Mon Sep 17 00:00:00 2001 From: fonsinchen Date: Sun, 11 May 2014 12:49:51 +0000 Subject: [PATCH] (svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts. --- src/cargopacket.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index 34f8c4243b..9b96be62eb 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -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;