From 3c8fe5171248f667848cbb391fe6e5c4e0418f46 Mon Sep 17 00:00:00 2001 From: mimo Date: Sun, 2 Aug 2015 17:24:04 +0000 Subject: [PATCH] complete b3f7b8633a for (un)packing This was SVN commit r16910. --- binaries/data/mods/public/simulation/components/UnitAI.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index c75cb75640..5fc38b6683 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -3291,8 +3291,9 @@ UnitAI.prototype.OnOwnershipChanged = function(msg) if (msg.to != -1 && msg.from != -1) { // Switch to a virgin state to let states execute their leave handlers. - // except if garrisoned or cheering, in which case we only clear the order queue - if (this.isGarrisoned || (this.orderQueue[0] && this.orderQueue[0].type == "Cheering")) + // except if garrisoned or cheering or (un)packing, in which case we only clear the order queue + if (this.isGarrisoned || (this.orderQueue[0] && (this.orderQueue[0].type == "Cheering" + || this.orderQueue[0].type == "Pack" || this.orderQueue[0].type == "Unpack"))) this.orderQueue.length = Math.min(this.orderQueue.length, 1); else { @@ -3304,9 +3305,10 @@ UnitAI.prototype.OnOwnershipChanged = function(msg) this.SetStance(this.template.DefaultStance); if (this.IsTurret()) - this.SetTurretStance(); + this.SetTurretStance(); } }; + UnitAI.prototype.OnDestroy = function() { // Switch to an empty state to let states execute their leave handlers.