From 39d182c35205ee6d8767bc0ebc86b5bc72367380 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 11 Jun 2019 21:50:19 +0300 Subject: [PATCH] (0ee266e33) Use the collider position as the reference point when deciding whether or not a platform should be ignored while checking the floor y. Fixes bots being unable to exit ladders if some part of their body is below the platform (#1589). TODO: test for negative implications. --- .../BarotraumaShared/Source/Characters/Animation/Ragdoll.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs b/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs index 52d84e829..43d64ee53 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs @@ -1427,7 +1427,7 @@ namespace Barotrauma Vector2 rayEnd = rayStart - new Vector2(0.0f, height); - var lowestLimb = FindLowestLimb(); + //var lowestLimb = FindLowestLimb(); float closestFraction = 1; GameMain.World.RayCast((fixture, point, normal, fraction) => @@ -1440,7 +1440,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 && TargetMovement.Y < -0.5f || Collider.Position.Y < platform.Rect.Y) return -1; break; case Physics.CollisionWall: case Physics.CollisionLevel: