diff --git a/OpenRA.Game/PathSearch.cs b/OpenRA.Game/PathSearch.cs index 63f1ef597a..108809a757 100755 --- a/OpenRA.Game/PathSearch.cs +++ b/OpenRA.Game/PathSearch.cs @@ -26,12 +26,14 @@ namespace OpenRA public Actor ignoreBuilding; Actor self; public bool inReverse; + Mobile mobile; public PathSearch(Actor self) { this.self = self; world = self.World; cellInfo = InitCellInfo(); + mobile = self.traits.Get(); queue = new PriorityQueue(); } @@ -78,7 +80,6 @@ namespace OpenRA cellInfo[p.Location.X, p.Location.Y].Seen = true; - var mobile = self.traits.Get(); var thisCost = mobile.MovementCostForCell(self, p.Location); if (thisCost == float.PositiveInfinity)