Fixed stack overflow when trying to store jumpsuits in themselves
This commit is contained in:
@@ -16,6 +16,8 @@ namespace Barotrauma
|
||||
|
||||
public override int FindAllowedSlot(Item item)
|
||||
{
|
||||
if (ItemOwnsSelf(item)) return -1;
|
||||
|
||||
for (int i = 0; i < capacity; i++)
|
||||
{
|
||||
//item is already in the inventory!
|
||||
@@ -34,6 +36,7 @@ namespace Barotrauma
|
||||
|
||||
public override bool CanBePut(Item item, int i)
|
||||
{
|
||||
if (ItemOwnsSelf(item)) return false;
|
||||
if (i < 0 || i >= Items.Length) return false;
|
||||
return (item!=null && Items[i]==null && container.CanBeContained(item));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user