diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-05-21 21:56:41 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-05-21 21:56:41 +0200 |
commit | 63b4c9869b6256ed7644113cd23305b07cf9df03 (patch) | |
tree | aff0d99f5b58cbaf4195ac755ecfb79f97bf7b65 /src/gui/widgets/itemshortcutcontainer.cpp | |
parent | 8c4c5a58c256cce7beb21b68c8a7d6b6ff5c4a3a (diff) | |
parent | 2953a3f92c5097bd99ff21f4536fe167a32d90c5 (diff) | |
download | mana-client-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.gz mana-client-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.bz2 mana-client-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.xz mana-client-63b4c9869b6256ed7644113cd23305b07cf9df03.zip |
Merge branch '1.0'
Conflicts:
src/beingmanager.cpp
src/beingmanager.h
src/client.cpp
src/localplayer.cpp
Diffstat (limited to 'src/gui/widgets/itemshortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 92e3e2e5..83efd4d4 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -142,9 +142,13 @@ void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event) if (!mItemMoved && mItemClicked) { const int index = getIndexFromGrid(event.getX(), event.getY()); + + if (index == -1) + return; + const int itemId = itemShortcut->getItem(index); - if (index == -1 || itemId < 0) + if (itemId < 0) return; Item *item = player_node->getInventory()->findItem(itemId); @@ -227,9 +231,13 @@ void ItemShortcutContainer::mouseReleased(gcn::MouseEvent &event) void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) { const int index = getIndexFromGrid(event.getX(), event.getY()); + + if (index == -1) + return; + const int itemId = itemShortcut->getItem(index); - if (index == -1 || itemId < 0) + if (itemId < 0) return; Item *item = player_node->getInventory()->findItem(itemId); |