(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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user