diff --git a/OpenRA.Mods.Common/Pathfinder/PathSearch.cs b/OpenRA.Mods.Common/Pathfinder/PathSearch.cs index 2c661dcd3e..f4a92f752e 100644 --- a/OpenRA.Mods.Common/Pathfinder/PathSearch.cs +++ b/OpenRA.Mods.Common/Pathfinder/PathSearch.cs @@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Pathfinder public IPathGraph Graph { get; } readonly Func heuristic; readonly int heuristicWeightPercentage; - public Func TargetPredicate { get; set; } + readonly Func targetPredicate; readonly IPriorityQueue openQueue; /// @@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Pathfinder Graph = graph; this.heuristic = heuristic; this.heuristicWeightPercentage = heuristicWeightPercentage; - TargetPredicate = targetPredicate; + this.targetPredicate = targetPredicate; openQueue = new PriorityQueue(GraphConnection.ConnectionCostComparer); } @@ -224,7 +224,7 @@ namespace OpenRA.Mods.Common.Pathfinder while (CanExpand()) { var p = Expand(); - if (TargetPredicate(p)) + if (targetPredicate(p)) return MakePath(Graph, p); }