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.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index c44ae9e7..06e43eac 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -245,11 +245,12 @@ void InventoryWindow::keyReleased(gcn::KeyEvent &event)
void InventoryWindow::valueChanged(const gcn::SelectionEvent &event)
{
- if (mSplit)
+ if (mSplit && Net::getInventoryHandler()->canSplit(mItems->getSelectedItem()))
{
Item *item = mItems->getSelectedItem();
- ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item,
+ if (item)
+ ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item,
(item->getQuantity() - 1));
}
}