From da23911dbc37e88139d0798e21fe04a1d305af52 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 14 Aug 2012 09:45:38 +0000 Subject: Shift-clicking the crafting grid in curvival inventory tries placing things in inventory first, then the hotbar. git-svn-id: http://mc-server.googlecode.com/svn/trunk@734 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cSurvivalInventory.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/cSurvivalInventory.cpp b/source/cSurvivalInventory.cpp index 50c750100..887868fd7 100644 --- a/source/cSurvivalInventory.cpp +++ b/source/cSurvivalInventory.cpp @@ -201,7 +201,14 @@ void cSurvivalInventory::ShiftClickedCraftingGrid(short a_Slot) { return; } + // First try the main inventory: Item->m_ItemCount -= MoveItem(Item->m_ItemID, Item->m_ItemHealth, Item->m_ItemCount, SLOT_INVENTORY_MIN, SLOT_INVENTORY_MAX); + + // If anything left, try the hotbar: + if (Item->m_ItemCount > 0) + { + Item->m_ItemCount -= MoveItem(Item->m_ItemID, Item->m_ItemHealth, Item->m_ItemCount, SLOT_HOTBAR_MIN, SLOT_HOTBAR_MAX); + } SendSlot(a_Slot); } -- cgit v1.2.3