add stance cycling on 'z'

This commit is contained in:
Chris Forbes
2011-10-11 09:18:31 +13:00
parent 59e4dd666a
commit 7f1918d07b
2 changed files with 34 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA
public enum UnitStance { HoldFire, ReturnFire, AttackAnything };
public class AutoTarget : INotifyIdle, INotifyDamage, ITick
public class AutoTarget : INotifyIdle, INotifyDamage, ITick, IResolveOrder
{
readonly AutoTargetInfo Info;
readonly AttackBase attack;
@@ -38,6 +38,12 @@ namespace OpenRA.Mods.RA
attack = self.Trait<AttackBase>();
}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "SetUnitStance")
stance = (UnitStance)order.TargetLocation.X;
}
public void Damaged(Actor self, AttackInfo e)
{
if (!self.IsIdle) return;