(961d41b31) Ragdoll syncing improvements: - Don't ignore platforms when correcting a ragdoll's position using Ragdoll.SetPosition. Otherwise forcing the character above a platform may cause it to drop down again if the feet don't end up above the platform. - Correct ragdoll position to server position immediately if the error is very large. - Force collider to stay upright after fixed rotation is enabled.

This commit is contained in:
Joonas Rikkonen
2019-04-29 21:07:44 +03:00
parent fedde72056
commit 1f3c6349ab
4 changed files with 77 additions and 16 deletions
@@ -379,7 +379,6 @@ namespace Barotrauma
{
//rotate collider back upright
Collider.AngularVelocity = MathUtils.GetShortestAngle(Collider.Rotation, 0.0f) * 10.0f;
Collider.FarseerBody.FixedRotation = false;
}
else
@@ -387,6 +386,14 @@ namespace Barotrauma
Collider.FarseerBody.FixedRotation = true;
}
}
else
{
float angleDiff = MathUtils.GetShortestAngle(Collider.Rotation, 0.0f);
if (Math.Abs(angleDiff) > 0.001f)
{
Collider.SetTransform(Collider.SimPosition, Collider.Rotation + angleDiff);
}
}
if (character.LockHands)
{