diff --git a/Subsurface/Source/Characters/AI/PathFinder.cs b/Subsurface/Source/Characters/AI/PathFinder.cs index a0b2f86ca..533444fc2 100644 --- a/Subsurface/Source/Characters/AI/PathFinder.cs +++ b/Subsurface/Source/Characters/AI/PathFinder.cs @@ -123,7 +123,8 @@ namespace Barotrauma if (startNode == null) { - DebugConsole.ThrowError("Pathfinding error, couldn't find a start node"); + DebugConsole.NewMessage("Pathfinding error, couldn't find a start node", Color.DarkRed); + return new SteeringPath(); } @@ -152,7 +153,7 @@ namespace Barotrauma if (endNode == null) { - DebugConsole.ThrowError("Pathfinding error, couldn't find an end node"); + DebugConsole.NewMessage("Pathfinding error, couldn't find an end node", Color.DarkRed); return new SteeringPath(); } @@ -185,7 +186,7 @@ namespace Barotrauma if (startNode == null || endNode == null) { - DebugConsole.ThrowError("Pathfinding error, couldn't find matching pathnodes to waypoints"); + DebugConsole.NewMessage("Pathfinding error, couldn't find matching pathnodes to waypoints", Color.DarkRed); return new SteeringPath(); } diff --git a/Subsurface/Source/Items/Components/Holdable/Pickable.cs b/Subsurface/Source/Items/Components/Holdable/Pickable.cs index 5db1f006c..13286a5e4 100644 --- a/Subsurface/Source/Items/Components/Holdable/Pickable.cs +++ b/Subsurface/Source/Items/Components/Holdable/Pickable.cs @@ -203,9 +203,11 @@ 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) { bodyDropPos = item.ParentInventory.Owner.SimPosition; + + if (item.body != null) item.body.ResetDynamics(); } } else @@ -217,6 +219,12 @@ namespace Barotrauma.Items.Components Limb rightHand = picker.AnimController.GetLimb(LimbType.RightHand); bodyDropPos = rightHand.SimPosition; + if (item.body!=null) + { + item.body.LinearVelocity = rightHand.body.LinearVelocity; + item.body.AngularVelocity = rightHand.body.AngularVelocity; + } + picker.Inventory.RemoveItem(item); picker = null; } diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index c070612e6..4e9fb0134 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -1680,7 +1680,7 @@ namespace Barotrauma if (body != null) { body.ReadNetworkData(message, sendingTime); - body.MoveToTargetPosition(false); + body.MoveToTargetPosition(); } break; case NetworkEventType.PhysicsBodyPosition: diff --git a/Subsurface/Source/Map/SubmarineBody.cs b/Subsurface/Source/Map/SubmarineBody.cs index 43678d85f..5341d9f7a 100644 --- a/Subsurface/Source/Map/SubmarineBody.cs +++ b/Subsurface/Source/Map/SubmarineBody.cs @@ -511,7 +511,8 @@ namespace Barotrauma foreach (Item item in Item.ItemList) { - if (item.Submarine != submarine || item.CurrentHull == null || item.body == null) continue; + if (item.Submarine != submarine || item.CurrentHull == null || + item.body == null || !item.body.Enabled) continue; item.body.ApplyLinearImpulse(item.body.Mass * impulse); }