From a3d675e1dde4c80e687c7264bc86c6189c13dddb Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 11 Mar 2009 11:34:43 -0600 Subject: Don't move stuff from inventory when not visible --- src/gui/itemshortcutcontainer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/itemshortcutcontainer.cpp') diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index 603e7e50..67525140 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "inventorywindow.h" #include "itemshortcutcontainer.h" #include "itempopup.h" #include "viewport.h" @@ -184,9 +185,8 @@ void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) if (event.getButton() == gcn::MouseEvent::LEFT) { - // Stores the selected item if theirs one. - if (itemShortcut->isItemSelected()) + if (itemShortcut->isItemSelected() && inventoryWindow->isVisible()) { itemShortcut->setItem(index); itemShortcut->setItemSelected(-1); @@ -247,7 +247,7 @@ void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) Item *item = player_node->getInventory()->findItem(itemId); - if (item) + if (item && inventoryWindow->isVisible()) { mItemPopup->setItem(item->getInfo()); mItemPopup->setOpaque(false); -- cgit v1.2.3-70-g09d2