(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
@@ -85,18 +85,12 @@ namespace Barotrauma
if (Character.Submarine != null || SelectedAiTarget?.Entity?.Submarine != null)
{
if (steeringManager != insideSteering)
{
insideSteering.Reset();
}
if (steeringManager != insideSteering) insideSteering.Reset();
steeringManager = insideSteering;
}
else
{
if (steeringManager != outsideSteering)
{
outsideSteering.Reset();
}
if (steeringManager != outsideSteering) outsideSteering.Reset();
steeringManager = outsideSteering;
}
@@ -424,7 +424,7 @@ namespace Barotrauma
// It's possible that we could reach another buttons.
// If this becomes an issue, we could go through them here and check if any of them are reachable
// (would have to cache a collection of buttons instead of a single reference in the CanAccess filter method above)
//currentPath.Unreachable = true;
currentPath.Unreachable = true;
return;
}
}
@@ -117,7 +117,7 @@ namespace Barotrauma
// Take the sub position into account in the sim pos
if (character.Submarine == null && Target.Submarine != null)
{
//currTargetSimPos += Target.Submarine.SimPosition;
currTargetSimPos += Target.Submarine.SimPosition;
}
else if (character.Submarine != null && Target.Submarine == null)
{
@@ -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;