Remove a bunch of unnecessary caching

This commit is contained in:
Paul Chote
2010-06-23 20:42:45 +12:00
parent b42589b479
commit 3e664779ef
5 changed files with 22 additions and 26 deletions

View File

@@ -76,7 +76,7 @@ namespace OpenRA.Mods.RA.Activities
self.QueueActivity(new Move(
() =>
{
return self.World.PathFinder.FindPath(PathSearch.Search(self, UnitMovementType.Wheel, true)
return self.World.PathFinder.FindPath(PathSearch.Search(self, true)
.WithHeuristic(loc => (res.GetResource(loc) != null && harv.Resources.Contains( res.GetResource(loc).info.Name )) ? 0 : 1)
.FromPoint(self.Location));
}));

View File

@@ -66,8 +66,6 @@ namespace OpenRA.Mods.RA
Actor ClosestProc(Actor self, Actor ignore)
{
var mobile = self.traits.Get<Mobile>();
var refs = self.World.Queries.OwnedBy[self.Owner]
.Where(x => x != ignore && x.traits.Contains<IAcceptOre>())
.ToList();
@@ -75,7 +73,6 @@ namespace OpenRA.Mods.RA
var path = self.World.PathFinder.FindPath(PathSearch.FromPoints(self,
refs.Select(r => r.Location + r.traits.Get<IAcceptOre>().DeliverOffset),
self.Location,
mobile.GetMovementType(),
false));
path.Reverse();
if (path.Count != 0)