From c9f09031defd4db752080c3286ad1f8e551eb973 Mon Sep 17 00:00:00 2001 From: Regalis Date: Sat, 25 Feb 2017 16:47:20 +0200 Subject: [PATCH] Re-enabled anchoring main limb to the collider when a remote player is unconscious (otherwise only the position of the collider will be synced, and the ragdoll won't follow it) + stunned characters can't send position updates --- .../Characters/Animation/HumanoidAnimController.cs | 10 +++++----- Subsurface/Source/Characters/Character.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs b/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs index 2be536010..5072c221b 100644 --- a/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs +++ b/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs @@ -64,16 +64,16 @@ namespace Barotrauma levitatingCollider = false; Collider.FarseerBody.FixedRotation = false; - /*if (character.IsRemotePlayer) + if (character.IsRemotePlayer) { MainLimb.pullJoint.WorldAnchorB = Collider.SimPosition; MainLimb.pullJoint.Enabled = true; } else - {*/ - Collider.LinearVelocity = (GetLimb(LimbType.Waist).SimPosition - Collider.SimPosition) * 20.0f; - Collider.SmoothRotate(GetLimb(LimbType.Torso).Rotation); - //} + { + Collider.LinearVelocity = (GetLimb(LimbType.Waist).SimPosition - Collider.SimPosition) * 20.0f; + Collider.SmoothRotate(GetLimb(LimbType.Torso).Rotation); + } if (stunTimer > 0) { diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index a81ced76b..0df0109bb 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -1805,7 +1805,7 @@ namespace Barotrauma { data = null; - if (GameMain.Server != null && (type != NetworkEventType.InventoryUpdate || (!IsUnconscious && !IsDead))) + if (GameMain.Server != null && (type != NetworkEventType.InventoryUpdate || (!IsUnconscious && !IsDead && Stun <= 0.0f))) { Client sender = GameMain.Server.ConnectedClients.Find(c => c.Connection == message.SenderConnection); if (sender == null || sender.Character != this) @@ -1997,7 +1997,7 @@ namespace Barotrauma return false; } - if (GameMain.Server != null && (isDead || IsUnconscious)) return false; + if (GameMain.Server != null && (isDead || IsUnconscious || Stun > 0.0f)) return false; keys[(int)InputType.Use].Held = actionKeyState; keys[(int)InputType.Use].SetState(false, actionKeyState);