Ragdoll.SetPosition takes platforms into account if the character isn't ignoring platforms (i.e. forcing a character on top of a platform won't make it fall through it), reaching the top/bottom of a ladder won't make networkplayers fall off, server ignores position updates from dead/unconscious characters, smaller ResetRagdollDistance
This commit is contained in:
@@ -814,15 +814,12 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
notClimbing = Math.Abs(targetMovement.X) > 0.05f;
|
||||
notClimbing = Math.Abs(targetMovement.X) > 0.05f ||
|
||||
(TargetMovement.Y < 0.0f && ConvertUnits.ToSimUnits(trigger.Height) + handPos.Y < HeadPosition) ||
|
||||
(TargetMovement.Y > 0.0f && handPos.Y > 0.1f);
|
||||
}
|
||||
|
||||
//stop climbing if:
|
||||
// - moving sideways
|
||||
// - reached the top or bottom of the ladder
|
||||
if (notClimbing ||
|
||||
(TargetMovement.Y < 0.0f && ConvertUnits.ToSimUnits(trigger.Height) + handPos.Y < HeadPosition) ||
|
||||
(TargetMovement.Y > 0.0f && handPos.Y > 0.1f))
|
||||
if (notClimbing)
|
||||
{
|
||||
Anim = Animation.None;
|
||||
character.SelectedConstruction = null;
|
||||
|
||||
@@ -793,7 +793,10 @@ namespace Barotrauma
|
||||
|
||||
if (original != simPosition)
|
||||
{
|
||||
Body body = Submarine.CheckVisibility(original, simPosition);
|
||||
Category collisionCategory = Physics.CollisionWall | Physics.CollisionLevel;
|
||||
if (!ignorePlatforms) collisionCategory |= Physics.CollisionPlatform;
|
||||
|
||||
Body body = Submarine.PickBody(original, simPosition, null, collisionCategory);
|
||||
|
||||
//if there's something in between the limbs
|
||||
if (body != null)
|
||||
@@ -803,13 +806,10 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (lerp)
|
||||
{
|
||||
limb.body.TargetPosition = movePos;
|
||||
limb.body.MoveToTargetPosition(Vector2.Distance(limb.SimPosition, movePos) < 10.0f);
|
||||
|
||||
limb.body.MoveToTargetPosition(Vector2.Distance(limb.SimPosition, movePos) < 10.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user