Add Patrol check to IsWalkingAndFighting

Differential Revision: https://code.wildfiregames.com/D1419
Reviewed by: mimo
Comments by: elexis
This was SVN commit r21633.
This commit is contained in:
temple 2018-03-31 00:21:34 +00:00
parent dda3346e99
commit 44081fbd13

View file

@ -3318,7 +3318,7 @@ UnitAI.prototype.IsWalking = function()
};
/**
* return true if in WalkAndFight looking for new targets
* Return true if the current order is WalkAndFight or Patrol.
*/
UnitAI.prototype.IsWalkingAndFighting = function()
{
@ -3328,7 +3328,7 @@ UnitAI.prototype.IsWalkingAndFighting = function()
return (cmpUnitAI && cmpUnitAI.IsWalkingAndFighting());
}
return (this.orderQueue.length > 0 && this.orderQueue[0].type == "WalkAndFight");
return this.orderQueue.length > 0 && (this.orderQueue[0].type == "WalkAndFight" || this.orderQueue[0].type == "Patrol");
};
UnitAI.prototype.OnCreate = function()