From 44081fbd13af995bc3c27db97e907f85ef8ab2e4 Mon Sep 17 00:00:00 2001 From: temple Date: Sat, 31 Mar 2018 00:21:34 +0000 Subject: [PATCH] Add Patrol check to IsWalkingAndFighting Differential Revision: https://code.wildfiregames.com/D1419 Reviewed by: mimo Comments by: elexis This was SVN commit r21633. --- binaries/data/mods/public/simulation/components/UnitAI.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index ec3326205e..724b82e70a 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -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()