Remove obsolete LocomotorInfo caching.

This commit is contained in:
Paul Chote
2020-10-10 21:01:30 +01:00
committed by Matthias Mailänder
parent 49e7a33db0
commit 5a7dc385a3
10 changed files with 35 additions and 94 deletions

View File

@@ -24,7 +24,6 @@ namespace OpenRA.Mods.Common.Activities
readonly Harvester harv;
readonly HarvesterInfo harvInfo;
readonly Mobile mobile;
readonly LocomotorInfo locomotorInfo;
readonly ResourceClaimLayer claimLayer;
readonly IPathFinder pathFinder;
readonly DomainIndex domainIndex;
@@ -43,7 +42,6 @@ namespace OpenRA.Mods.Common.Activities
harv = self.Trait<Harvester>();
harvInfo = self.Info.TraitInfo<HarvesterInfo>();
mobile = self.Trait<Mobile>();
locomotorInfo = mobile.Info.LocomotorInfo;
claimLayer = self.World.WorldActor.Trait<ResourceClaimLayer>();
pathFinder = self.World.WorldActor.Trait<IPathFinder>();
domainIndex = self.World.WorldActor.Trait<DomainIndex>();
@@ -195,7 +193,7 @@ namespace OpenRA.Mods.Common.Activities
// Find any harvestable resources:
List<CPos> path;
using (var search = PathSearch.Search(self.World, mobile.Locomotor, self, BlockedByActor.Stationary, loc =>
domainIndex.IsPassable(self.Location, loc, locomotorInfo) && harv.CanHarvestCell(self, loc) && claimLayer.CanClaimCell(self, loc))
domainIndex.IsPassable(self.Location, loc, mobile.Locomotor) && harv.CanHarvestCell(self, loc) && claimLayer.CanClaimCell(self, loc))
.WithCustomCost(loc =>
{
if ((loc - searchFromLoc.Value).LengthSquared > searchRadiusSquared)