summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-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()->