Removing items from their parent inventory in item.Drop
This commit is contained in:
@@ -564,6 +564,7 @@ namespace Barotrauma
|
||||
if (newItemIDs[i] == 0)
|
||||
{
|
||||
if (Items[i] != null) Items[i].Drop();
|
||||
System.Diagnostics.Debug.Assert(Items[i]==null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1529,7 +1529,17 @@ namespace Barotrauma
|
||||
{
|
||||
foreach (ItemComponent ic in components) ic.Drop(dropper);
|
||||
|
||||
if (Container != null) Container.RemoveContained(this);
|
||||
if (Container != null)
|
||||
{
|
||||
Container.RemoveContained(this);
|
||||
Container = null;
|
||||
}
|
||||
|
||||
if (parentInventory != null)
|
||||
{
|
||||
parentInventory.RemoveItem(this);
|
||||
parentInventory = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void Equip(Character character)
|
||||
|
||||
Reference in New Issue
Block a user