diff options
author | fonsinchen <fonsinchen@openttd.org> | 2014-05-11 12:49:51 +0000 |
---|---|---|
committer | fonsinchen <fonsinchen@openttd.org> | 2014-05-11 12:49:51 +0000 |
commit | a363b2c317c681888ca0f09c94f3c811f04b9921 (patch) | |
tree | 580e36e6e51be740b27a38e0d30ab499a86c8b04 | |
parent | e673115842d077724c0b532486e176990c7b59d6 (diff) | |
download | openttd-a363b2c317c681888ca0f09c94f3c811f04b9921.tar.xz |
(svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts.
-rw-r--r-- | src/cargopacket.cpp | 1 |
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; |