(b00ce5ec2) Fixed character's feet levitating when standing at the base of a staircase without climbing it. Closes #1275
This commit is contained in:
@@ -599,7 +599,7 @@ namespace Barotrauma
|
||||
waist.PullJointEnabled = true;
|
||||
}
|
||||
|
||||
float floorPos = GetFloorY(colliderPos + new Vector2(Math.Sign(movement.X) * 0.5f, 1.0f));
|
||||
float floorPos = GetFloorY(colliderPos + new Vector2(Math.Sign(movement.X) * 0.5f, 1.0f), ignoreStairs: Stairs == null);
|
||||
bool onSlope = floorPos > GetColliderBottom().Y + 0.05f;
|
||||
|
||||
if (Stairs != null || onSlope)
|
||||
|
||||
@@ -1391,14 +1391,14 @@ namespace Barotrauma
|
||||
|
||||
partial void Splash(Limb limb, Hull limbHull);
|
||||
|
||||
protected float GetFloorY(Limb refLimb = null)
|
||||
protected float GetFloorY(Limb refLimb = null, bool ignoreStairs = false)
|
||||
{
|
||||
PhysicsBody refBody = refLimb == null ? Collider : refLimb.body;
|
||||
|
||||
return GetFloorY(refBody.SimPosition);
|
||||
return GetFloorY(refBody.SimPosition, ignoreStairs);
|
||||
}
|
||||
|
||||
protected float GetFloorY(Vector2 simPosition)
|
||||
protected float GetFloorY(Vector2 simPosition, bool ignoreStairs = false)
|
||||
{
|
||||
Vector2 rayStart = simPosition;
|
||||
float height = ColliderHeightFromFloor;
|
||||
@@ -1415,6 +1415,7 @@ namespace Barotrauma
|
||||
switch (fixture.CollisionCategories)
|
||||
{
|
||||
case Physics.CollisionStairs:
|
||||
if (ignoreStairs) return -1;
|
||||
if (inWater && TargetMovement.Y < 0.5f) return -1;
|
||||
break;
|
||||
case Physics.CollisionPlatform:
|
||||
|
||||
Reference in New Issue
Block a user