diff --git a/OpenRA.Mods.RA/Move/PathSearch.cs b/OpenRA.Mods.RA/Move/PathSearch.cs index ce23ab2b60..bdfed9a183 100755 --- a/OpenRA.Mods.RA/Move/PathSearch.cs +++ b/OpenRA.Mods.RA/Move/PathSearch.cs @@ -33,7 +33,6 @@ namespace OpenRA.Mods.RA.Move MobileInfo mobileInfo; Func customCost; Func customBlock; - Pair[] nextDirections; int laneBias = 1; public PathSearch(World world, MobileInfo mobileInfo, Actor self) @@ -46,7 +45,6 @@ namespace OpenRA.Mods.RA.Move Queue = new PriorityQueue(); Considered = new HashSet(); MaxCost = 0; - nextDirections = CVec.directions.Select(d => new Pair(d, 0)).ToArray(); } public static PathSearch Search(World world, MobileInfo mi, Actor self, bool checkForBlocked) @@ -170,10 +168,11 @@ namespace OpenRA.Mods.RA.Move // This current cell is ok; check all immediate directions: Considered.Add(p.Location); - for (var i = 0; i < nextDirections.Length; ++i) + var directions = CVec.directions; + + for (var i = 0; i < directions.Length; ++i) { - var d = nextDirections[i].First; - nextDirections[i].Second = int.MaxValue; + var d = directions[i]; var newHere = p.Location + d; @@ -239,7 +238,6 @@ namespace OpenRA.Mods.RA.Move hereCell.MinCost = newCost; CellInfo[newHere] = hereCell; - nextDirections[i].Second = newCost + est; Queue.Add(new PathDistance(newCost + est, newHere)); if (newCost > MaxCost) @@ -248,8 +246,6 @@ namespace OpenRA.Mods.RA.Move Considered.Add(newHere); } - // Sort to prefer the cheaper direction: - // Array.Sort(nextDirections, (a, b) => a.Second.CompareTo(b.Second)); return p.Location; }