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

@@ -48,9 +48,7 @@ namespace OpenRA.Mods.Common.Traits
var aircraftInfo = producee.TraitInfoOrDefault<AircraftInfo>();
var mobileInfo = producee.TraitInfoOrDefault<MobileInfo>();
var locomotorInfo = mobileInfo.LocomotorInfo;
var passable = mobileInfo != null ? (uint)locomotorInfo.GetMovementClass(self.World.Map.Rules.TileSet) : 0;
var destination = rp != null ? rp.Location : self.Location;
var location = spawnLocation;
@@ -60,8 +58,11 @@ namespace OpenRA.Mods.Common.Traits
location = self.World.Map.ChooseClosestEdgeCell(self.Location);
if (mobileInfo != null)
{
var locomotorInfo = mobileInfo.LocomotorInfo;
location = self.World.Map.ChooseClosestMatchingEdgeCell(self.Location,
c => mobileInfo.CanEnterCell(self.World, null, c) && domainIndex.IsPassable(c, destination, locomotorInfo, passable));
c => mobileInfo.CanEnterCell(self.World, null, c) && domainIndex.IsPassable(c, destination, locomotorInfo));
}
}
// No suitable spawn location could be found, so production has failed.