summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-03-25 19:17:07 -0400
committerChuck Miller <shadowmil@gmail.com>2010-03-25 19:26:34 -0400
commit58c39fb8449526e8334c41fc48abdeedde39ca62 (patch)
treedfceb43c37aaaa45ea07dd474b6556e36c68c8a9
parent8745368108563d7c32820b989c3ea794ccb834f9 (diff)
downloadmana-58c39fb8449526e8334c41fc48abdeedde39ca62.tar.gz
mana-58c39fb8449526e8334c41fc48abdeedde39ca62.tar.bz2
mana-58c39fb8449526e8334c41fc48abdeedde39ca62.tar.xz
mana-58c39fb8449526e8334c41fc48abdeedde39ca62.zip
Fix crash in inventory window, adds quick retrieve to the window
Reviewed-by: Jared Adams
-rw-r--r--src/gui/inventorywindow.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 26f12285..bb6f021e 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -240,10 +240,14 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
if(!item)
return;
-
- Net::getInventoryHandler()->moveItem(Inventory::INVENTORY,
- item->getInvIndex(), item->getQuantity(),
- Inventory::STORAGE);
+ if (mInventory->isMainInventory())
+ Net::getInventoryHandler()->moveItem(Inventory::INVENTORY,
+ item->getInvIndex(), item->getQuantity(),
+ Inventory::STORAGE);
+ else
+ Net::getInventoryHandler()->moveItem(Inventory::STORAGE,
+ item->getInvIndex(), item->getQuantity(),
+ Inventory::INVENTORY);
}
}
}
@@ -272,6 +276,9 @@ void InventoryWindow::keyReleased(gcn::KeyEvent &event)
void InventoryWindow::valueChanged(const gcn::SelectionEvent &event)
{
+ if (!mInventory->isMainInventory())
+ return;
+
Item *item = mItems->getSelectedItem();
if (mSplit && Net::getInventoryHandler()->