diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-29 23:56:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-29 23:56:26 +0300 |
commit | 598de45a1e77e5f10c69694f607941336163673f (patch) | |
tree | ab0082f18939c41c402e90d99fbaa298aa21a3c9 /src/gui/widgets | |
parent | b0cddefee60e56525fe4da0404f18af71c14acaf (diff) | |
download | plus-598de45a1e77e5f10c69694f607941336163673f.tar.gz plus-598de45a1e77e5f10c69694f607941336163673f.tar.bz2 plus-598de45a1e77e5f10c69694f607941336163673f.tar.xz plus-598de45a1e77e5f10c69694f607941336163673f.zip |
Dont allow add same item twice into npc inventory.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 773f43ff7..8fc8b09e4 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -631,23 +631,8 @@ void ItemContainer::mouseReleased(MouseEvent &event) inventory = PlayerInfo::getInventory(); if (inventory) { - const Item *const item = inventory->getItem(dragDrop.getTag()); - if (item && !PlayerInfo::isItemProtected(item->getId())) - { - const int index = mInventory->addItem(item->getId(), - item->getType(), - 1, - 1, - item->getColor(), - item->getIdentified(), - item->getDamaged(), - item->getFavorite(), - Equipm_false, - Equipped_false); - Item *const item2 = mInventory->getItem(index); - if (item2) - item2->setTag(item->getInvIndex()); - } + mInventory->addVirtualItem(inventory->getItem( + dragDrop.getTag())); } return; } |