From 4421c8a5dec77526abc60cb69ca00594578eb648 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 8 Mar 2018 10:43:54 +0200 Subject: [PATCH] Fixed camera shake continuing indefinitely if a character falls unconscious due to impact damage --- .../Animation/HumanoidAnimController.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Animation/HumanoidAnimController.cs b/Barotrauma/BarotraumaShared/Source/Characters/Animation/HumanoidAnimController.cs index aebc19264..ae83fb868 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Animation/HumanoidAnimController.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Animation/HumanoidAnimController.cs @@ -80,6 +80,14 @@ namespace Barotrauma ColliderIndex = Crouching ? 1 : 0; if (!Crouching && ColliderIndex == 1) Crouching = true; + //stun (= disable the animations) if the ragdoll receives a large enough impact + if (strongestImpact > 0.0f) + { + character.SetStun(MathHelper.Min(strongestImpact * 0.5f, 5.0f)); + strongestImpact = 0.0f; + return; + } + if (!character.AllowInput) { levitatingCollider = false; @@ -95,15 +103,6 @@ namespace Barotrauma return; } - //stun (= disable the animations) if the ragdoll receives a large enough impact - if (strongestImpact > 0.0f) - { - character.SetStun(MathHelper.Min(strongestImpact * 0.5f, 5.0f)); - strongestImpact = 0.0f; - return; - } - - //re-enable collider if (!Collider.Enabled) {