(86c9256b3) Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:35:10 +03:00
parent 65a914e5ed
commit f1d794cb39
21 changed files with 241 additions and 162 deletions
@@ -165,8 +165,8 @@ namespace Barotrauma
{
Vector2 nodePos = node.Position;
float xDiff = System.Math.Abs(start.X - nodePos.X);
float yDiff = System.Math.Abs(start.Y - nodePos.Y);
float xDiff = Math.Abs(start.X - nodePos.X);
float yDiff = Math.Abs(start.Y - nodePos.Y);
if (yDiff > 1.0f && node.Waypoint.Ladders == null && node.Waypoint.Stairs == null)
{
@@ -190,7 +190,7 @@ namespace Barotrauma
if (body != null)
{
if (body.UserData is Submarine) continue;
//if (body.UserData is Submarine) continue;
if (body.UserData is Structure && !((Structure)body.UserData).IsPlatform) continue;
if (body.UserData is Item && body.FixtureList[0].CollisionCategories.HasFlag(Physics.CollisionWall)) continue;
}
@@ -216,8 +216,7 @@ namespace Barotrauma
{
Vector2 nodePos = node.Position;
// TODO: use squared distance
float dist = Vector2.Distance(end, nodePos);
float dist = Vector2.DistanceSquared(end, nodePos);
if (insideSubmarine)
{
//much higher cost to waypoints that are outside
@@ -235,7 +234,7 @@ namespace Barotrauma
if (body != null)
{
if (body.UserData is Submarine) continue;
//if (body.UserData is Submarine) continue;
if (body.UserData is Structure && !((Structure)body.UserData).IsPlatform) continue;
if (body.UserData is Item && body.FixtureList[0].CollisionCategories.HasFlag(Physics.CollisionWall)) continue;