summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r--src/gui/widgets/itemcontainer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 0967055b..2cd0fa23 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -278,12 +278,19 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event)
{
const int index = getSlotIndex(event.getX(), event.getY());
if (index == Inventory::NO_SLOT_INDEX)
+ {
+ mSelectionStatus = SEL_DESELECTING;
return;
+ }
Item *item = getItemAt(index);
if (!item)
+ {
+ mSelectionStatus = SEL_DESELECTING;
return;
+ }
+
// put item name into chat window
if (mDescItems)
@@ -293,7 +300,6 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event)
if (mSelectedIndex == index)
{
- mSelectionStatus = SEL_DESELECTING;
}
else if (item && item->getId())
{