diff --git a/Subsurface/Content/Characters/Human/human.xml b/Subsurface/Content/Characters/Human/human.xml index b190c755c..e62c83b47 100644 --- a/Subsurface/Content/Characters/Human/human.xml +++ b/Subsurface/Content/Characters/Human/human.xml @@ -11,10 +11,11 @@ thightorque="-5.0" walkspeed="1.5" swimspeed="2.0" - impacttolerance="7.5"> + impacttolerance="7.5" + colliderheightfromfloor="55"> - - + + diff --git a/Subsurface/Source/Characters/Animation/Ragdoll.cs b/Subsurface/Source/Characters/Animation/Ragdoll.cs index 554f84770..a41292c3b 100644 --- a/Subsurface/Source/Characters/Animation/Ragdoll.cs +++ b/Subsurface/Source/Characters/Animation/Ragdoll.cs @@ -70,6 +70,8 @@ namespace Barotrauma protected bool inWater, headInWater; public bool onGround; private bool ignorePlatforms; + + private float colliderHeightFromFloor; protected Structure stairs; @@ -101,7 +103,7 @@ namespace Barotrauma if (collider[colliderIndex].height f.CollisionCategories.HasFlag(Physics.CollisionWall))) return; @@ -300,6 +302,9 @@ namespace Barotrauma CanEnterSubmarine = ToolBox.GetAttributeBool(element, "canentersubmarine", true); + colliderHeightFromFloor = ToolBox.GetAttributeFloat(element, "colliderheightfromfloor", 45.0f); + colliderHeightFromFloor = ConvertUnits.ToSimUnits(colliderHeightFromFloor); + collider = new List(); foreach (XElement subElement in element.Elements()) @@ -994,7 +999,7 @@ namespace Barotrauma break; case Physics.CollisionPlatform: Structure platform = fixture.Body.UserData as Structure; - if (IgnorePlatforms || lowestLimb.Position.Y < platform.Rect.Y) return -1; + if (IgnorePlatforms || lowestLimb.Position.Y < platform.Rect.Y-16) return -1; break; case Physics.CollisionWall: break; @@ -1027,7 +1032,7 @@ namespace Barotrauma } float tfloorY = rayStart.Y + (rayEnd.Y - rayStart.Y) * closestFraction; - float targetY = tfloorY + Collider.height * 0.5f + Collider.radius + ConvertUnits.ToSimUnits(45.0f); + float targetY = tfloorY + Collider.height * 0.5f + Collider.radius + colliderHeightFromFloor; if (Math.Abs(Collider.SimPosition.Y - targetY) > 0.01f && Collider.SimPosition.Y