From 6b47d5c07c40a5ae3f4b4df147e7d89aa94f2304 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 11 Jan 2011 03:52:55 +0200 Subject: Add missing check to itemcontainer.cpp --- src/gui/widgets/itemcontainer.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.3-70-g09d2