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 d6cd3a84..47f66e76 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -233,11 +233,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));
}
}