Replace DomainIndex passability hack with Locomotor boolean

This commit is contained in:
reaperrr
2018-04-29 17:39:04 +02:00
committed by abcdefg30
parent 5364515004
commit e7fb32b09c
4 changed files with 7 additions and 2 deletions

View File

@@ -44,8 +44,7 @@ namespace OpenRA.Mods.Common.Traits
if (p1.Layer != 0 || p2.Layer != 0)
return true;
// HACK: Workaround until we can generalize movement classes
if (li is SubterraneanLocomotorInfo || li is JumpjetLocomotorInfo)
if (li.DisableDomainPassabilityCheck)
return true;
var movementClass = li.GetMovementClass(tileSet);

View File

@@ -25,6 +25,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Can this actor transition on slopes?")]
public readonly bool JumpjetTransitionOnRamps = true;
public override bool DisableDomainPassabilityCheck { get { return true; } }
public override object Create(ActorInitializer init) { return new JumpjetLocomotor(init.Self, this); }
}

View File

@@ -287,6 +287,8 @@ namespace OpenRA.Mods.Common.Traits
return true;
}
public virtual bool DisableDomainPassabilityCheck { get { return false; } }
public virtual object Create(ActorInitializer init) { return new Locomotor(init.Self, this); }
}

View File

@@ -29,6 +29,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Depth at which the subterranian condition is applied.")]
public readonly WDist SubterraneanTransitionDepth = new WDist(-1024);
public override bool DisableDomainPassabilityCheck { get { return true; } }
public override object Create(ActorInitializer init) { return new SubterraneanLocomotor(init.Self, this); }
}