a little faster -- don't look up the Mobile every expand either.
This commit is contained in:
@@ -26,12 +26,14 @@ namespace OpenRA
|
|||||||
public Actor ignoreBuilding;
|
public Actor ignoreBuilding;
|
||||||
Actor self;
|
Actor self;
|
||||||
public bool inReverse;
|
public bool inReverse;
|
||||||
|
Mobile mobile;
|
||||||
|
|
||||||
public PathSearch(Actor self)
|
public PathSearch(Actor self)
|
||||||
{
|
{
|
||||||
this.self = self;
|
this.self = self;
|
||||||
world = self.World;
|
world = self.World;
|
||||||
cellInfo = InitCellInfo();
|
cellInfo = InitCellInfo();
|
||||||
|
mobile = self.traits.Get<Mobile>();
|
||||||
queue = new PriorityQueue<PathDistance>();
|
queue = new PriorityQueue<PathDistance>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +80,6 @@ namespace OpenRA
|
|||||||
|
|
||||||
cellInfo[p.Location.X, p.Location.Y].Seen = true;
|
cellInfo[p.Location.X, p.Location.Y].Seen = true;
|
||||||
|
|
||||||
var mobile = self.traits.Get<Mobile>();
|
|
||||||
var thisCost = mobile.MovementCostForCell(self, p.Location);
|
var thisCost = mobile.MovementCostForCell(self, p.Location);
|
||||||
|
|
||||||
if (thisCost == float.PositiveInfinity)
|
if (thisCost == float.PositiveInfinity)
|
||||||
|
|||||||
Reference in New Issue
Block a user