add movement-free autotarget option

This commit is contained in:
Chris Forbes
2010-08-18 17:47:38 +12:00
parent 0cf51d8142
commit 1c6470eff3

View File

@@ -17,6 +17,7 @@ namespace OpenRA.Mods.RA
{
public readonly float ScanTimeAverage = 2f;
public readonly float ScanTimeSpread = .5f;
public readonly bool AllowMovement = true;
}
class AutoTarget : ITick, INotifyDamage
@@ -28,7 +29,12 @@ namespace OpenRA.Mods.RA
{
var attack = self.Trait<AttackBase>();
if (target != null)
attack.ResolveOrder(self, new Order("Attack", self, target));
{
if (self.Info.Traits.Get<AutoTargetInfo>().AllowMovement)
attack.ResolveOrder(self, new Order("Attack", self, target));
else
attack.target = Target.FromActor(target); // for turreted things on rails.
}
}
public void Tick(Actor self)