mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts.
This commit is contained in:
parent
e673115842
commit
a363b2c317
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue