From 598de45a1e77e5f10c69694f607941336163673f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 29 Oct 2015 23:56:26 +0300 Subject: Dont allow add same item twice into npc inventory. --- src/gui/windows/npcdialog.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/gui/windows') 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) { -- cgit v1.2.3-60-g2f50