(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.

This commit is contained in:
Joonas Rikkonen
2019-06-11 21:50:19 +03:00
parent 8f4cbad15c
commit 39d182c352

View File

@@ -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: