Fixed camera shake continuing indefinitely if a character falls unconscious due to impact damage
This commit is contained in:
@@ -80,6 +80,14 @@ namespace Barotrauma
|
|||||||
ColliderIndex = Crouching ? 1 : 0;
|
ColliderIndex = Crouching ? 1 : 0;
|
||||||
if (!Crouching && ColliderIndex == 1) Crouching = true;
|
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)
|
if (!character.AllowInput)
|
||||||
{
|
{
|
||||||
levitatingCollider = false;
|
levitatingCollider = false;
|
||||||
@@ -95,15 +103,6 @@ namespace Barotrauma
|
|||||||
return;
|
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
|
//re-enable collider
|
||||||
if (!Collider.Enabled)
|
if (!Collider.Enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user