(6d989732) Unstable v0.9.708.0

This commit is contained in:
Juan Pablo Arce
2020-02-12 16:05:02 -03:00
parent 2783125162
commit 27e10f7c2e
37 changed files with 420 additions and 345 deletions
@@ -204,14 +204,14 @@ namespace Barotrauma.Items.Components
if (picker == null || picker.Inventory == null)
{
if (item.ParentInventory != null && item.ParentInventory.Owner != null)
if (item.ParentInventory != null && item.ParentInventory.Owner != null && !item.ParentInventory.Owner.Removed)
{
bodyDropPos = item.ParentInventory.Owner.SimPosition;
if (item.body != null) item.body.ResetDynamics();
}
}
else
else if (!picker.Removed)
{
DropConnectedWires(picker);
@@ -224,9 +224,18 @@ namespace Barotrauma.Items.Components
if (item.body != null && !item.body.Enabled)
{
item.body.ResetDynamics();
item.SetTransform(bodyDropPos, 0.0f);
item.body.Enabled = true;
if (item.body.Removed)
{
DebugConsole.ThrowError(
"Failed to drop the Pickable component of the item \"" + item.Name + "\" (body has been removed"
+ (item.Removed ? ", item has been removed)" : ")"));
}
else
{
item.body.ResetDynamics();
item.SetTransform(bodyDropPos, 0.0f);
item.body.Enabled = true;
}
}
}