1
0
forked from 0ad/0ad

fix initialization of this.oldAttackType used for resetting the attack anims, fix #3221

This was SVN commit r17075.
This commit is contained in:
mimo 2015-09-24 21:55:09 +00:00
parent aceff9ab15
commit 037fe8282e

View File

@ -1796,6 +1796,7 @@ UnitAI.prototype.UnitFsmSpec = {
prepare = Math.max(prepare, repeatLeft);
}
this.oldAttack = this.order.data.attackType;
// add prefix + no capital first letter for attackType
var animationName = "attack_" + this.order.data.attackType.toLowerCase();
if (this.IsFormationMember())
@ -1897,7 +1898,6 @@ UnitAI.prototype.UnitFsmSpec = {
return;
}
this.oldAttackType = this.order.data.attackType;
// Can't reach it, no longer owned by enemy, or it doesn't exist any more - give up
// Except if in WalkAndFight mode where we look for more ennemies around before moving again
if (this.FinishOrder())