Pathfinding fixes:

- determining if a character is close enough to a waypoint works now, even if the character is too short for its collider to overlap with the wp (e.g. crawlers)
- enemies can drop down from platforms
- an extra waypoint is placed at the middle of stairs to prevent characters from choosing a waypoint on a platform above the stairs as the starting point of their path
This commit is contained in:
Regalis
2016-11-23 22:20:20 +02:00
parent 9061f0e53a
commit 9d1d64901a
4 changed files with 53 additions and 8 deletions
+5 -3
View File
@@ -444,7 +444,7 @@ namespace Barotrauma
foreach (Structure stairs in stairList)
{
WayPoint[] stairPoints = new WayPoint[2];
WayPoint[] stairPoints = new WayPoint[3];
stairPoints[0] = new WayPoint(
new Vector2(stairs.Rect.X - 32.0f,
@@ -463,8 +463,10 @@ namespace Barotrauma
stairPoints[i].ConnectTo(closest);
}
}
stairPoints[0].ConnectTo(stairPoints[1]);
stairPoints[2] = new WayPoint((stairPoints[0].Position + stairPoints[1].Position)/2, SpawnType.Path, submarine);
stairPoints[0].ConnectTo(stairPoints[2]);
stairPoints[2].ConnectTo(stairPoints[1]);
}
foreach (Item item in Item.ItemList)