diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index c440b661d..dd7088178 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -1702,7 +1702,7 @@ namespace Barotrauma { data = null; - if (GameMain.Server != null && type != NetworkEventType.InventoryUpdate) + if (GameMain.Server != null && (type != NetworkEventType.InventoryUpdate || (!IsUnconscious && !IsDead))) { Client sender = GameMain.Server.ConnectedClients.Find(c => c.Connection == message.SenderConnection); if (sender == null || sender.Character != this) diff --git a/Subsurface/Source/Items/Components/Door.cs b/Subsurface/Source/Items/Components/Door.cs index dfef7cf75..50f02411f 100644 --- a/Subsurface/Source/Items/Components/Door.cs +++ b/Subsurface/Source/Items/Components/Door.cs @@ -487,6 +487,10 @@ namespace Barotrauma.Items.Components public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetIncomingMessage message, float sendingTime) { if (sendingTime < lastReceivedMessage) return; + if (GameMain.Server != null) + { + return; + } lastReceivedMessage = sendingTime; diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index 38f6c6eab..12dbc4508 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -1732,13 +1732,22 @@ namespace Barotrauma { return false; } + Drop(sender.Character, false); + if (body != null) + { + body.TargetPosition = sender.Character.SimPosition; + body.MoveToTargetPosition(); + } } - - Drop(null, false); - if (body != null) + else { - body.ReadNetworkData(message, sendingTime); - body.MoveToTargetPosition(); + //client should not tell the server where the item should drop + Drop(null, false); + if (body != null) + { + body.ReadNetworkData(message, sendingTime); + body.MoveToTargetPosition(); + } } break; case NetworkEventType.PhysicsBodyPosition: diff --git a/Subsurface/Source/Physics/PhysicsBody.cs b/Subsurface/Source/Physics/PhysicsBody.cs index d859dbae1..a134bd980 100644 --- a/Subsurface/Source/Physics/PhysicsBody.cs +++ b/Subsurface/Source/Physics/PhysicsBody.cs @@ -395,6 +395,10 @@ namespace Barotrauma public void ReadNetworkData(NetIncomingMessage message, float sendingTime) { + if (GameMain.Server != null) + { + return; + } if (sendingTime < lastNetworkUpdateTime) return; Vector2 newTargetPos = Vector2.Zero;