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

@@ -26,7 +26,6 @@ namespace OpenRA.Mods.Common.Activities
protected readonly Mobile Mobile;
readonly IPathFinder pathFinder;
readonly DomainIndex domainIndex;
readonly uint movementClass;
Target target;
bool canHideUnderFog;
@@ -56,7 +55,6 @@ namespace OpenRA.Mods.Common.Activities
Mobile = self.Trait<Mobile>();
pathFinder = self.World.WorldActor.Trait<IPathFinder>();
domainIndex = self.World.WorldActor.Trait<DomainIndex>();
movementClass = (uint)Mobile.Info.LocomotorInfo.GetMovementClass(self.World.Map.Rules.TileSet);
if (target.IsValidFor(self))
targetPosition = self.World.Map.CellContaining(target.CenterPosition);
@@ -142,7 +140,7 @@ namespace OpenRA.Mods.Common.Activities
var loc = self.Location;
foreach (var cell in targetCells)
if (domainIndex.IsPassable(loc, cell, Mobile.Info.LocomotorInfo, movementClass) && Mobile.CanEnterCell(cell))
if (domainIndex.IsPassable(loc, cell, Mobile.Info.LocomotorInfo) && Mobile.CanEnterCell(cell))
searchCells.Add(cell);
if (!searchCells.Any())