(svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts.
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user