From 1b2f49cb65200eaab379fed577f61277d2b2ebba Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Aug 2015 19:18:57 +0300 Subject: Use item tag for dragged items. --- src/gui/widgets/itemcontainer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2