summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/itemcontainer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 0ba676fe5..b9123bc5a 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -434,6 +434,9 @@ void ItemContainer::updateMatrix()
int ItemContainer::getSlotIndex(int x, int y) const
{
+ if (!mShowMatrix)
+ return Inventory::NO_SLOT_INDEX;
+
if (x < getWidth() && y < getHeight())
{
int idx = (y / BOX_HEIGHT) * mGridColumns + (x / BOX_WIDTH);