summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-21 19:18:57 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-21 19:22:36 +0300
commit1b2f49cb65200eaab379fed577f61277d2b2ebba (patch)
tree22252c6f68d2c649ec407fee8a6b41850af624b7 /src/gui/widgets/itemcontainer.cpp
parent2dc2a95e4aa1466f7fd29f41b2b976ab47241259 (diff)
downloadmanaverse-1b2f49cb65200eaab379fed577f61277d2b2ebba.tar.gz
manaverse-1b2f49cb65200eaab379fed577f61277d2b2ebba.tar.bz2
manaverse-1b2f49cb65200eaab379fed577f61277d2b2ebba.tar.xz
manaverse-1b2f49cb65200eaab379fed577f61277d2b2ebba.zip
Use item tag for dragged items.
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r--src/gui/widgets/itemcontainer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index b533aadd3..75ef1e852 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -634,7 +634,8 @@ void ItemContainer::mouseReleased(MouseEvent &event)
const Item *const item = inventory->getItem(dragDrop.getTag());
if (item && !PlayerInfo::isItemProtected(item->getId()))
{
- mInventory->addItem(item->getId(), item->getType(),
+ const int index = mInventory->addItem(item->getId(),
+ item->getType(),
1,
1,
item->getColor(),
@@ -643,6 +644,9 @@ void ItemContainer::mouseReleased(MouseEvent &event)
item->getFavorite(),
Equipm_false,
Equipped_false);
+ Item *const item2 = mInventory->getItem(index);
+ if (item2)
+ item2->setTag(item->getInvIndex());
}
}
return;