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 @@ -958,7 +958,7 @@ if (!cmpPosition || !cmpPosition.IsInWorld()) { this.FinishOrder(); - return; + return true; } if (!this.patrolStartPosOrder) { @@ -1066,6 +1066,7 @@ } this.CallMemberFunction("Garrison", [this.order.data.target, false]); this.SetNextState("MEMBER"); + return true; }, }, }, @@ -1155,7 +1156,6 @@ cmpFormation.SetRearrange(!this.IsAttackingAsFormation()); cmpFormation.MoveMembersIntoFormation(false, false); this.StartTimer(200, 200); - return false; }, "Timer": function(msg) { @@ -1506,7 +1506,7 @@ if (!this.MoveTo(this.order.data)) { this.FinishOrder(); - return; + return true; } this.SelectAnimation("move"); }, @@ -1526,7 +1526,7 @@ if (!this.MoveTo(this.order.data)) { this.FinishOrder(); - return; + return true; } // Show weapons rather than carried resources. this.SetAnimationVariant("combat"); @@ -1558,7 +1558,7 @@ !this.MoveTo(this.order.data)) { this.FinishOrder(); - return; + return true; } if (!this.patrolStartPosOrder) @@ -1604,7 +1604,7 @@ if (!this.MoveToTargetRangeExplicit(this.isGuardOf, 0, this.guardRange)) { this.FinishOrder(); - return; + return true; } // Show weapons rather than carried resources. @@ -1613,7 +1613,6 @@ this.StartTimer(0, 1000); this.SelectAnimation("move"); this.SetHeldPositionOnEntity(this.isGuardOf); - return false; }, "Timer": function(msg) { @@ -1662,7 +1661,6 @@ this.SetHeldPositionOnEntity(this.entity); this.SetAnimationVariant("combat"); this.SelectAnimation("idle"); - return false; }, "LosRangeUpdate": function(msg) { @@ -1714,7 +1712,7 @@ !cmpUnitMotion || !cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) { this.FinishOrder(); - return; + return true; } this.PlaySound("panic"); @@ -1759,7 +1757,7 @@ if (!this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) { this.FinishOrder(); - return; + return true; } // Show weapons rather than carried resources. @@ -1836,12 +1834,12 @@ if (this.CanPack()) { this.PushOrderFront("Pack", { "force": true }); - return; + return false; } if (this.MoveToTargetAttackRange(target, this.order.data.attackType)) { this.SetNextState("COMBAT.CHASING"); - return; + return true; } } } @@ -2017,7 +2015,7 @@ if (!this.MoveTo(this.order.data)) { this.FinishOrder(); - return; + return true; } // Show weapons rather than carried resources. @@ -2203,7 +2201,7 @@ if (!this.MoveTo(this.order.data)) { this.FinishOrder(); - return; + return true; } this.SelectAnimation("move"); }, @@ -2983,8 +2981,10 @@ delete this.pickup; } - if (this.IsTurret()) + if (this.IsTurret()) { this.SetNextState("IDLE"); + return true; + } return false; } @@ -3006,7 +3006,7 @@ if (!this.CheckTargetRangeExplicit(target, 0, 0) && this.MoveToTarget(target)) { this.SetNextState("APPROACHING"); - return false; + return true; } } } @@ -3027,7 +3027,6 @@ cmpDamageReceiver.SetInvulnerability(true); this.SelectAnimation("promotion"); this.StartTimer(2800, 2800); - return false; }, "leave": function() { @@ -3116,7 +3115,6 @@ this.FinishOrder(); return true; } - return false; }, "PickupCanceled": function() {