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 @@ -910,6 +910,7 @@ "enter": function(msg) { var cmpFormation = Engine.QueryInterface(this.entity, IID_Formation); cmpFormation.SetRearrange(false); + return false; }, }, @@ -923,6 +924,7 @@ let cmpFormation = Engine.QueryInterface(this.entity, IID_Formation); cmpFormation.SetRearrange(true); cmpFormation.MoveMembersIntoFormation(true, true); + return false; }, "leave": function() { @@ -949,6 +951,7 @@ let cmpFormation = Engine.QueryInterface(this.entity, IID_Formation); cmpFormation.SetRearrange(true); cmpFormation.MoveMembersIntoFormation(true, true); + return false; }, "leave": function() { @@ -977,7 +980,7 @@ if (!cmpPosition || !cmpPosition.IsInWorld()) { this.FinishOrder(); - return; + return true; } if (!this.patrolStartPosOrder) { @@ -996,6 +999,7 @@ let cmpFormation = Engine.QueryInterface(this.entity, IID_Formation); cmpFormation.SetRearrange(true); cmpFormation.MoveMembersIntoFormation(true, true); + return false; }, "Timer": function(msg) { @@ -1039,6 +1043,7 @@ this.pickup = this.order.data.target; // temporary, deleted in "leave" Engine.PostMessage(this.pickup, MT_PickupRequested, { "entity": this.entity }); } + return false; }, "leave": function() { @@ -1061,6 +1066,7 @@ let cmpFormation = Engine.QueryInterface(this.entity, IID_Formation); cmpFormation.SetRearrange(true); cmpFormation.MoveMembersIntoFormation(true, true); + return false; }, "leave": function() { @@ -1083,6 +1089,7 @@ } this.CallMemberFunction("Garrison", [this.order.data.target, false]); this.SetNextState("MEMBER"); + return true; }, }, }, @@ -1129,6 +1136,7 @@ let cmpFormation = Engine.QueryInterface(this.entity, IID_Formation); cmpFormation.SetRearrange(true); cmpFormation.MoveMembersIntoFormation(true, true); + return false; }, "leave": function() { @@ -1204,6 +1212,7 @@ cmpFormation.SetRearrange(false); this.StopMoving(); this.StartTimer(1000, 1000); + return false; }, "Timer": function(msg) { @@ -1293,6 +1302,7 @@ let cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation); if (cmpFormation) this.SetAnimationVariant(cmpFormation.GetFormationAnimation(this.entity)); + return false; }, "leave": function() { @@ -1306,6 +1316,7 @@ this.formationOffset = { "x": this.order.data.x, "z": this.order.data.z }; let cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); cmpUnitMotion.MoveToFormationOffset(this.order.data.target, this.order.data.x, this.order.data.z); + return false; }, "leave": function() { @@ -1347,6 +1358,7 @@ this.FinishOrder(); return true; } + return false; }, "MovementUpdate": function() { @@ -1366,6 +1378,7 @@ // Sanity-checking if (this.IsAnimal()) error("Animal got moved into INDIVIDUAL.* state"); + return false; }, "Attacked": function(msg) { @@ -1442,6 +1455,7 @@ // but sending this info in Idle.enter will send spurious messages. // Pick 100 to execute on the next turn in SP and MP. this.StartTimer(100); + return false; }, "leave": function() { @@ -1518,6 +1532,7 @@ this.FinishOrder(); return true; } + return false; }, "leave": function() { @@ -1544,6 +1559,7 @@ this.SetAnimationVariant("combat"); this.StartTimer(0, 1000); + return false; }, "Timer": function(msg) { @@ -1585,6 +1601,7 @@ this.StartTimer(0, 1000); this.SetAnimationVariant("combat"); + return false; }, "leave": function() { @@ -1736,6 +1753,7 @@ // Run quickly this.SetSpeedMultiplier(this.GetRunMultiplier()); + return false; }, "HealthChanged": function() { @@ -1781,6 +1799,7 @@ this.SetAnimationVariant("combat"); this.StartTimer(1000, 1000); + return false; }, "leave": function() { @@ -1910,6 +1929,7 @@ let cmpBuildingAI = Engine.QueryInterface(this.entity, IID_BuildingAI); if (cmpBuildingAI) cmpBuildingAI.SetUnitAITarget(this.order.data.target); + return false; }, "leave": function() { @@ -2042,6 +2062,7 @@ this.SetSpeedMultiplier(this.GetRunMultiplier()); } this.StartTimer(1000, 1000); + return false; }, "leave": function() { @@ -2147,6 +2168,7 @@ this.FinishOrder(); return true; } + return false; }, "leave": function() { @@ -2430,6 +2452,7 @@ } this.StartTimer(1000, 1000); + return false; }, "leave": function() { @@ -2484,6 +2507,7 @@ this.resyncAnimation = prepare != this.healTimers.prepare; this.FaceTowardsTarget(this.order.data.target); + return false; }, "leave": function() { @@ -2561,6 +2585,7 @@ this.FinishOrder(); return true; } + return false; }, "leave": function() { @@ -2627,6 +2652,7 @@ this.FinishOrder(); return true; } + return false; }, "leave": function() { @@ -2666,6 +2692,7 @@ this.FinishOrder(); return true; } + return false; }, "leave": function() { @@ -2858,6 +2885,7 @@ this.pickup = this.order.data.target; // temporary, deleted in "leave" Engine.PostMessage(this.pickup, MT_PickupRequested, { "entity": this.entity }); } + return false; }, "leave": function() { @@ -2877,6 +2905,7 @@ this.FinishOrder(); return true; } + return false; }, "leave": function() { @@ -3016,6 +3045,7 @@ var cmpPack = Engine.QueryInterface(this.entity, IID_Pack); cmpPack.Pack(); + return false; }, "PackFinished": function(msg) { @@ -3036,6 +3066,7 @@ var cmpPack = Engine.QueryInterface(this.entity, IID_Pack); cmpPack.Unpack(); + return false; }, "PackFinished": function(msg) { @@ -3058,6 +3089,7 @@ this.FinishOrder(); return true; } + return false; }, "leave": function() { @@ -3142,6 +3174,7 @@ this.MoveRandomly(+this.template.RoamDistance); // Set a random timer to switch to feeding state this.StartTimer(randIntInclusive(+this.template.RoamTimeMin, +this.template.RoamTimeMax)); + return false; }, "leave": function() { @@ -3187,6 +3220,7 @@ this.SelectAnimation("feeding"); this.StopMoving(); this.StartTimer(randIntInclusive(+this.template.FeedTimeMin, +this.template.FeedTimeMax)); + return false; }, "leave": function() {