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 (newItemIDs[i] == 0)
|
||||||
{
|
{
|
||||||
if (Items[i] != null) Items[i].Drop();
|
if (Items[i] != null) Items[i].Drop();
|
||||||
|
System.Diagnostics.Debug.Assert(Items[i]==null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1529,7 +1529,17 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
foreach (ItemComponent ic in components) ic.Drop(dropper);
|
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)
|
public void Equip(Character character)
|
||||||
|
|||||||
Reference in New Issue
Block a user