Index: binaries/data/mods/public/simulation/components/UnitAI.js =================================================================== --- binaries/data/mods/public/simulation/components/UnitAI.js +++ binaries/data/mods/public/simulation/components/UnitAI.js @@ -1931,6 +1931,24 @@ return; } + // Check we can still reach the target for this attack. + if (!this.CheckTargetAttackRange(target, this.order.data.attackType)) + { + // Can't reach it - try to chase after it. + if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) + { + if (this.CanPack()) + { + this.PushOrderFront("Pack", { "force": true }); + return; + } + this.SetNextState("COMBAT.CHASING"); + return; + } + this.SetNextState("COMBAT.FINDINGNEWTARGET"); + return; + } + this.RememberTargetPosition(); if (this.order.data.hunting && this.orderQueue.length > 1 && this.orderQueue[1].type === "Gather") this.RememberTargetPosition(this.orderQueue[1].data);