From 0d0353f8f36fc572d5a4f85f7e83684c543a434e Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 26 Jul 2010 20:33:42 +1200 Subject: [PATCH] a little faster -- don't look up the Mobile every expand either. --- OpenRA.Game/PathSearch.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)