make order queuing work for buildings and turreted units, too

This commit is contained in:
Bob
2010-11-14 15:48:02 +13:00
parent 7c146a9d5d
commit f8e6245903
16 changed files with 128 additions and 129 deletions

View File

@@ -8,7 +8,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
public class UnitStanceInfo : ITraitInfo
public class UnitStanceInfo : ITraitInfo, ITraitPrerequisite<AttackBaseInfo>
{
public readonly bool Default = false;
public readonly int ScanDelayMin = 12;
@@ -167,12 +167,8 @@ namespace OpenRA.Mods.RA
public static void AttackTarget(Actor self, Actor target, bool holdStill)
{
var attack = self.Trait<AttackBase>();
if (attack != null && target != null)
{
attack.ResolveOrder(self, new Order((holdStill) ? "AttackHold" : "Attack", self, target, false));
}
if (target != null)
self.Trait<AttackBase>().AttackTarget(Target.FromActor(target), false, !holdStill);
}
public static void StopAttack(Actor self)
@@ -199,7 +195,7 @@ namespace OpenRA.Mods.RA
public static Actor ScanForTarget(Actor self)
{
return self.Trait<AttackBase>().ScanForTarget(self);
return self.Trait<AttackBase>().ScanForTarget(self, null);
}
public void ResolveOrder(Actor self, Order order)