add option to ban attacking ground

This commit is contained in:
Chris Forbes
2010-09-16 17:53:59 +12:00
parent 82875e15f9
commit c91bee8091

View File

@@ -34,6 +34,7 @@ namespace OpenRA.Mods.RA
public readonly int FireDelay = 0; public readonly int FireDelay = 0;
public readonly bool AlignIdleTurrets = false; public readonly bool AlignIdleTurrets = false;
public readonly bool CanAttackGround = true;
public virtual object Create(ActorInitializer init) { return new AttackBase(init.self); } public virtual object Create(ActorInitializer init) { return new AttackBase(init.self); }
} }
@@ -205,6 +206,7 @@ namespace OpenRA.Mods.RA
if (!target.IsActor) if (!target.IsActor)
{ {
if (!forceFire) return null; if (!forceFire) return null;
if (!self.Info.Traits.Get<AttackBaseInfo>().CanAttackGround) return null;
return new Order("Attack", self, xy); return new Order("Attack", self, xy);
} }