Fixed a major bug

Fixed a potential loop crash caused by an undefined amount int in TakeInventory (and derivatives) now it will assume if by is less than 1 that the item is to be destroyed.
This commit is contained in:
XLightningStormL 2025-05-14 09:48:52 +10:00 committed by Ricardo Luís Vaz Silva
commit 1f1d9dc1b5

View file

@ -932,7 +932,7 @@ class Inventory : Actor
//===========================================================================
virtual void DepleteBy(int by)
{
if (amount < 1 || by >= amount)
if (by < 1 || amount < 1 || by >= amount)
{
DepleteOrDestroy();
}