a little faster -- don't look up the Mobile every expand either.

This commit is contained in:
Chris Forbes
2010-07-26 20:33:42 +12:00
parent 637fae87cd
commit 0d0353f8f3

View File

@@ -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<Mobile>();
queue = new PriorityQueue<PathDistance>();
}
@@ -78,7 +80,6 @@ namespace OpenRA
cellInfo[p.Location.X, p.Location.Y].Seen = true;
var mobile = self.traits.Get<Mobile>();
var thisCost = mobile.MovementCostForCell(self, p.Location);
if (thisCost == float.PositiveInfinity)