summaryrefslogtreecommitdiff
path: root/src/gui/windows/npcdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-29 23:56:26 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-29 23:56:26 +0300
commit598de45a1e77e5f10c69694f607941336163673f (patch)
treeab0082f18939c41c402e90d99fbaa298aa21a3c9 /src/gui/windows/npcdialog.cpp
parentb0cddefee60e56525fe4da0404f18af71c14acaf (diff)
downloadplus-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/windows/npcdialog.cpp')
-rw-r--r--src/gui/windows/npcdialog.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 51edbaf3b..5cc538e34 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -542,25 +542,7 @@ void NpcDialog::action(const ActionEvent &event)
else if (eventId == "add")
{
if (inventoryWindow)
- {
- const Item *const item = inventoryWindow->getSelectedItem();
- if (item)
- {
- 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(inventoryWindow->getSelectedItem());
}
else if (eventId.find("skin_") == 0)
{