diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-07-17 21:10:44 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-07-17 21:10:44 +0000 |
commit | 9bf3338f82bfbd425debb2855d015c7bd0e33989 (patch) | |
tree | ba390f42ebb7149e91c3494bc6a4ef3ac919ae22 /src/gui/sell.cpp | |
parent | fbf19c2cdde592b126fe91c0dfff480f1318f50c (diff) | |
download | mana-9bf3338f82bfbd425debb2855d015c7bd0e33989.tar.gz mana-9bf3338f82bfbd425debb2855d015c7bd0e33989.tar.bz2 mana-9bf3338f82bfbd425debb2855d015c7bd0e33989.tar.xz mana-9bf3338f82bfbd425debb2855d015c7bd0e33989.zip |
Added Item and Equipment class and made the appropriate places make use of them. Plus some cleanups.
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r-- | src/gui/sell.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index 5693e091..5ce56438 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -29,7 +29,6 @@ #include "listbox.h" #include "../game.h" #include "../net/network.h" -#include "../resources/itemmanager.h" #include <sstream> @@ -91,15 +90,19 @@ void SellDialog::reset() void SellDialog::addItem(short index, int price) { - int id = inventoryWindow->items->getId(index); + Item *item = inventoryWindow->items->getItem(index); + + if (!item) + return; + ITEM_SHOP item_shop; sprintf(item_shop.name, "%s %i gp", - itemDb->getItemInfo(id)->getName().c_str(), price); + item->getInfo()->getName().c_str(), price); item_shop.price = price; item_shop.index = index; - item_shop.id = id; - item_shop.quantity = inventoryWindow->items->getQuantity(index); + item_shop.id = item->getId();; + item_shop.quantity = item->getQuantity(); shopInventory.push_back(item_shop); itemList->adjustSize(); |