Fixes
This commit is contained in:
@@ -243,7 +243,6 @@ namespace Barotrauma
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
subBody.LastReceivedPositionUpdate = Math.Max(subBody.LastReceivedPositionUpdate, Timing.TotalTime);
|
|
||||||
subBody.MemPos.Insert(index, new PosInfo(newTargetPosition, 0.0f, sendingTime));
|
subBody.MemPos.Insert(index, new PosInfo(newTargetPosition, 0.0f, sendingTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1332,23 +1332,23 @@ namespace Barotrauma
|
|||||||
character.AnimController.Anim = AnimController.Animation.None;
|
character.AnimController.Anim = AnimController.Animation.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 newVelocity = overrideTargetMovement;
|
Vector2 newVelocity = Vector2.Zero;
|
||||||
Vector2 newPosition = Collider.SimPosition;
|
Vector2 newPosition = Collider.SimPosition;
|
||||||
Collider.CorrectPosition(character.MemState, deltaTime, out newVelocity, out newPosition);
|
Collider.CorrectPosition(character.MemState, deltaTime, out newVelocity, out newPosition);
|
||||||
|
|
||||||
newVelocity = newVelocity.ClampLength(100.0f);
|
newVelocity = newVelocity.ClampLength(100.0f);
|
||||||
if (!MathUtils.IsValid(newVelocity)) newVelocity = Vector2.Zero;
|
if (!MathUtils.IsValid(newVelocity)) newVelocity = Vector2.Zero;
|
||||||
|
overrideTargetMovement = newVelocity;
|
||||||
Collider.LinearVelocity = newVelocity;
|
Collider.LinearVelocity = newVelocity;
|
||||||
|
|
||||||
float distSqrd = Vector2.DistanceSquared(newPosition, Collider.SimPosition);
|
float distSqrd = Vector2.DistanceSquared(newPosition, Collider.SimPosition);
|
||||||
if (distSqrd > 10.0f)
|
if (distSqrd > 10.0f)
|
||||||
{
|
{
|
||||||
SetPosition(newPosition);
|
SetPosition(newPosition);
|
||||||
}
|
}
|
||||||
else if (distSqrd > 0.1f)
|
else if (distSqrd > 0.01f)
|
||||||
{
|
{
|
||||||
Collider.SetTransform(newPosition, Collider.Rotation);
|
Collider.SetTransform(newPosition, Collider.Rotation);
|
||||||
overrideTargetMovement = newVelocity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//unconscious/dead characters can't correct their position using AnimController movement
|
//unconscious/dead characters can't correct their position using AnimController movement
|
||||||
|
|||||||
Reference in New Issue
Block a user