From 1407a08f0087905edae30ac3793e83757ff56d4c Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Sat, 23 May 2009 05:53:31 -0400 Subject: Fixes a segmentfault and disables shift split for eA --- src/gui/inventorywindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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)); } } -- cgit v1.2.3-70-g09d2