Don't pass movement class via IsPassable directly

Let IsPassable get that info from the locomotor instead.
This commit is contained in:
reaperrr
2018-03-23 23:47:03 +01:00
committed by abcdefg30
parent a52e83ca49
commit 5364515004
9 changed files with 25 additions and 35 deletions

View File

@@ -126,10 +126,9 @@ namespace OpenRA.Mods.Common.Activities
var searchRadiusSquared = searchRadius * searchRadius;
// Find any harvestable resources:
var passable = (uint)locomotorInfo.GetMovementClass(self.World.Map.Rules.TileSet);
List<CPos> path;
using (var search = PathSearch.Search(self.World, locomotorInfo, self, true, loc =>
domainIndex.IsPassable(self.Location, loc, locomotorInfo, passable) && harv.CanHarvestCell(self, loc) && claimLayer.CanClaimCell(self, loc))
domainIndex.IsPassable(self.Location, loc, locomotorInfo) && harv.CanHarvestCell(self, loc) && claimLayer.CanClaimCell(self, loc))
.WithCustomCost(loc =>
{
if ((avoidCell.HasValue && loc == avoidCell.Value) ||