Update inventory.zs

amount is integer, depleteordestroy should occur when amount is less than 1
This commit is contained in:
XLightningStormL 2024-07-09 11:38:38 +10:00 committed by GitHub
parent 8efb00189f
commit 85edffc166
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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