From f1c7ff4b47a0456a99315d8ffaf69f360358e1b1 Mon Sep 17 00:00:00 2001 From: C9Glax <13404778+C9Glax@users.noreply.github.com> Date: Thu, 17 Nov 2022 20:36:08 +0100 Subject: [PATCH] combined warnings #debug --- astar/Astar.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/astar/Astar.cs b/astar/Astar.cs index 926463b..50c42dc 100644 --- a/astar/Astar.cs +++ b/astar/Astar.cs @@ -50,14 +50,13 @@ namespace astar return new Route(new List(), false, float.MaxValue, float.MaxValue); } +#pragma warning disable CS8604, CS8600 // Route was found, so has to have a previous node and edges List tempNodes = new(); tempNodes.Add(goal); while(currentNode != start) { -#pragma warning disable CS8604, CS8600 // Route was found, so has to have a previous node tempNodes.Add(GetPreviousNodeOf(currentNode)); currentNode = GetPreviousNodeOf(currentNode); -#pragma warning restore CS8604, CS8600 } tempNodes.Reverse(); @@ -66,10 +65,8 @@ namespace astar for(int i = 0; i < tempNodes.Count - 1; i++) { -#pragma warning disable CS8600, CS8604 // Route was found, so has to have an edge Edge e = tempNodes[i].GetEdgeToNode(tempNodes[i + 1]); steps.Add(new Step(tempNodes[i], e, GetTimeRequiredToReach(tempNodes[i]), GetDistanceToGoal(tempNodes[i]))); -#pragma warning restore CS8600, CS8604 totalDistance += e.distance; } @@ -94,8 +91,9 @@ namespace astar } return _route; +#pragma warning restore CS8604, CS8600 } - + /* * Compares two nodes and returns the node closer to the goal * -1 => n1 smaller n2