The collider position of the controlled character is synced with the same interpolation logic as the rest of the characters when unconscious/stunned (todo: make the ragdoll follow the collider even when unconscious/dead/stunned)
This commit is contained in:
@@ -570,7 +570,7 @@ namespace Barotrauma
|
|||||||
limb.body.DebugDraw(spriteBatch, inWater ? Color.Cyan : Color.White);
|
limb.body.DebugDraw(spriteBatch, inWater ? Color.Cyan : Color.White);
|
||||||
}
|
}
|
||||||
|
|
||||||
Collider.DebugDraw(spriteBatch, inWater ? Color.SkyBlue : Color.Gray);
|
Collider.DebugDraw(spriteBatch, frozen ? Color.Red : (inWater ? Color.SkyBlue : Color.Gray));
|
||||||
|
|
||||||
foreach (RevoluteJoint joint in limbJoints)
|
foreach (RevoluteJoint joint in limbJoints)
|
||||||
{
|
{
|
||||||
@@ -1197,7 +1197,17 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (GameMain.NetworkMember == null) return;
|
if (GameMain.NetworkMember == null) return;
|
||||||
|
|
||||||
if (character == GameMain.NetworkMember.Character)
|
if (character != GameMain.NetworkMember.Character ||
|
||||||
|
character.IsUnconscious || character.Stun > 0.0f)
|
||||||
|
{
|
||||||
|
//use simple interpolation for other players' characters and unconscious characters
|
||||||
|
if (character.MemPos.Count > 0)
|
||||||
|
{
|
||||||
|
Collider.LinearVelocity = Vector2.Zero;
|
||||||
|
Collider.CorrectPosition(character.MemPos, deltaTime, out overrideTargetMovement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (character.MemPos.Count < 1) return;
|
if (character.MemPos.Count < 1) return;
|
||||||
|
|
||||||
@@ -1241,14 +1251,6 @@ namespace Barotrauma
|
|||||||
if (character.MemLocalPos.Count > 120) character.MemLocalPos.RemoveRange(0, character.MemLocalPos.Count - 120);
|
if (character.MemLocalPos.Count > 120) character.MemLocalPos.RemoveRange(0, character.MemLocalPos.Count - 120);
|
||||||
character.MemPos.Clear();
|
character.MemPos.Clear();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (character.MemPos.Count > 0)
|
|
||||||
{
|
|
||||||
Collider.LinearVelocity = Vector2.Zero;
|
|
||||||
Collider.CorrectPosition(character.MemPos, deltaTime, out overrideTargetMovement);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector2 GetFlowForce()
|
private Vector2 GetFlowForce()
|
||||||
|
|||||||
Reference in New Issue
Block a user