Implement subterranean units.

This commit is contained in:
Paul Chote
2017-01-08 20:10:54 +00:00
parent bb5f25e0dc
commit 572c1cb89f
14 changed files with 228 additions and 9 deletions

View File

@@ -37,13 +37,17 @@ namespace OpenRA.Mods.Common.Traits
domainIndexes[mc] = new MovementClassDomainIndex(world, mc);
}
public bool IsPassable(CPos p1, CPos p2, uint movementClass)
public bool IsPassable(CPos p1, CPos p2, MobileInfo mi, uint movementClass)
{
// HACK: Work around units in other movement layers from being blocked
// when the point in the main layer is not pathable
if (p1.Layer != 0 || p2.Layer != 0)
return true;
// HACK: Workaround until we can generalize movement classes
if (mi.Subterranean)
return true;
return domainIndexes[movementClass].IsPassable(p1, p2);
}