From 9a743d65fe73959b5aa6aa7bbfc28fa9fc25f097 Mon Sep 17 00:00:00 2001 From: sanderd17 Date: Sun, 15 Jun 2014 12:43:52 +0000 Subject: [PATCH] Fix to unitAI by FalseVision + fix a mistake of my own This was SVN commit r15363. --- binaries/data/mods/public/gui/session/unit_commands.js | 9 ++++----- .../data/mods/public/simulation/components/UnitAI.js | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/binaries/data/mods/public/gui/session/unit_commands.js b/binaries/data/mods/public/gui/session/unit_commands.js index 3af15ef91a..8d4a6edceb 100644 --- a/binaries/data/mods/public/gui/session/unit_commands.js +++ b/binaries/data/mods/public/gui/session/unit_commands.js @@ -188,6 +188,10 @@ function setupUnitPanel(guiName, usedPanels, unitEntState, playerState, items, c // Determine how many buttons there should be if (g_SelectionPanels[guiName].maxNumberOfItems) numberOfItems = Math.min(g_SelectionPanels[guiName].maxNumberOfItems, numberOfItems); + if (g_SelectionPanels[guiName].rowLength) + var rowLength = g_SelectionPanels[guiName].rowLength; + else + var rowLength = 8; // TODO get this out of here // Common code for garrison and 'unload all' button counts. @@ -210,11 +214,6 @@ function setupUnitPanel(guiName, usedPanels, unitEntState, playerState, items, c panel.size = size; } - if (g_SelectionPanels[guiName].rowLength) - var rowLength = g_SelectionPanels[guiName].rowLength; - else - var rowLength = 8; - // Make buttons for (var i = 0; i < numberOfItems; i++) { diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index 445ea3e59c..3327d3fe00 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -3561,7 +3561,7 @@ UnitAI.prototype.PushOrderFront = function(type, data) else if (this.order && this.IsPacking()) { var packingOrder = this.orderQueue.shift(); - this.orderQueue.unshift = (packingOrder, order); + this.orderQueue.unshift(packingOrder, order); } else {