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 {