1
0
forked from 0ad/0ad
This was SVN commit r13751.
This commit is contained in:
leper 2013-08-24 14:24:37 +00:00
parent 957c51727b
commit 9d933087b3

View File

@ -390,10 +390,20 @@ var UnitFsmSpec = {
return;
}
if (this.order.data.attackTypeUnchanged)
{
if (this.IsAnimal())
this.SetNextState("ANIMAL.COMBAT.ATTACKING");
else
this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
}
else
{
if (this.IsAnimal())
this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
else
this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
}
return;
}
@ -1460,7 +1470,12 @@ var UnitFsmSpec = {
if (this.FindNewTargets())
{
// Attempt to immediately re-enter the timer function, to avoid wasting the attack.
// Only do so if the new target has the same attackType as the current one
if (this.order.data.attackType == this.orderQueue[0].data.attackType)
{
this.TimerHandler(msg.data, msg.lateness);
this.orderQueue[0].data.attackTypeUnchanged = true;
}
return;
}