summaryrefslogtreecommitdiff
path: root/src/cargopacket.cpp
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-05-11 12:49:51 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-05-11 12:49:51 +0000
commita363b2c317c681888ca0f09c94f3c811f04b9921 (patch)
tree580e36e6e51be740b27a38e0d30ab499a86c8b04 /src/cargopacket.cpp
parente673115842d077724c0b532486e176990c7b59d6 (diff)
downloadopenttd-a363b2c317c681888ca0f09c94f3c811f04b9921.tar.xz
(svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts.
Diffstat (limited to 'src/cargopacket.cpp')
-rw-r--r--src/cargopacket.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp
index 34f8c4243..9b96be62e 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;