diff options
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r-- | src/gui/inventorywindow.cpp | 5 |
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)); } } |