Revert "Fixes AttackMove moving even if an enemy is within range."

This reverts commit a155c7b7ac.
This commit is contained in:
Paul Chote
2014-12-22 15:17:51 +13:00
parent e212517bbb
commit 488f0d1140
3 changed files with 17 additions and 44 deletions

View File

@@ -101,7 +101,7 @@ namespace OpenRA.Mods.RA
Aggressor = attacker;
if (at == null || !at.IsReachableTarget(at.Target, info.AllowMovement && Stance != UnitStance.Defend))
self.QueueActivity(false, Attack(self, Aggressor));
Attack(self, Aggressor);
}
public void TickIdle(Actor self)
@@ -111,13 +111,7 @@ namespace OpenRA.Mods.RA
var allowMovement = info.AllowMovement && Stance != UnitStance.Defend;
if (at == null || !at.IsReachableTarget(at.Target, allowMovement))
{
var act = ScanAndAttack(self);
if (act != null)
{
self.QueueActivity(false, act);
}
}
ScanAndAttack(self);
}
public void Tick(Actor self)
@@ -138,25 +132,19 @@ namespace OpenRA.Mods.RA
return currentTarget;
}
public void ResetScanTimer()
{
nextScanTime = 0;
}
public Activity ScanAndAttack(Actor self)
public void ScanAndAttack(Actor self)
{
var targetActor = ScanForTarget(self, null);
if (targetActor != null)
return Attack(self, targetActor);
return null;
Attack(self, targetActor);
}
Activity Attack(Actor self, Actor targetActor)
void Attack(Actor self, Actor targetActor)
{
TargetedActor = targetActor;
var target = Target.FromActor(targetActor);
self.SetTargetLine(target, Color.Red, false);
return attack.AttackTarget(target, info.AllowMovement && Stance != UnitStance.Defend);
attack.AttackTarget(target, false, info.AllowMovement && Stance != UnitStance.Defend);
}
Actor ChooseTarget(Actor self, WRange range)