(f4acd46ef) Don't enable the "report leaks" button inside ruins

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:29:24 +03:00
parent 6463face3b
commit 75640a321f
9 changed files with 100 additions and 119 deletions
@@ -165,8 +165,8 @@ namespace Barotrauma
{
Vector2 nodePos = node.Position;
float xDiff = Math.Abs(start.X - nodePos.X);
float yDiff = Math.Abs(start.Y - nodePos.Y);
float xDiff = System.Math.Abs(start.X - nodePos.X);
float yDiff = System.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,7 +216,8 @@ namespace Barotrauma
{
Vector2 nodePos = node.Position;
float dist = Vector2.DistanceSquared(end, nodePos);
// TODO: use squared distance
float dist = Vector2.Distance(end, nodePos);
if (insideSubmarine)
{
//much higher cost to waypoints that are outside
@@ -234,7 +235,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;