Index: ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js +++ ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js @@ -5586,6 +5586,16 @@ this.RememberTargetPosition(order); + if (this.order && this.order.type == "Attack" && + this.order.data && + this.order.data.target === order.target && + this.order.data.allowCapture === order.allowCapture) + { + this.order.data.lastPos = order.lastPos; + this.order.data.force = order.force; + return; + } + this.AddOrder("Attack", order, queued); }; @@ -5672,6 +5682,16 @@ this.RememberTargetPosition(order); order.initPos = order.lastPos; + if (this.order && + (this.order.type == "Gather" || this.order.type == "Attack") && + this.order.data && + this.order.data.target === order.target) + { + this.order.data.lastPos = order.lastPos; + this.order.data.force = order.force; + return; + } + this.AddOrder("Gather", order, queued); }; @@ -5701,6 +5721,14 @@ return; } + if (this.order && this.order.type == "Heal" && + this.order.data && + this.order.data.target === target) + { + this.order.data.force = true; + return; + } + this.AddOrder("Heal", { "target": target, "force": true }, queued); }; @@ -5890,6 +5918,15 @@ return; } + if (this.order && this.order.type == "Repair" && + this.order.data && + this.order.data.target === target && + this.order.data.autocontinue === autocontinue) + { + this.order.data.force = true; + return; + } + this.AddOrder("Repair", { "target": target, "autocontinue": autocontinue, "force": true }, queued); };