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:
parent
0532a298d2
commit
1f1d9dc1b5
1 changed files with 1 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue