summaryrefslogtreecommitdiff
path: root/src/gui/sell.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-17 21:10:44 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-17 21:10:44 +0000
commit9bf3338f82bfbd425debb2855d015c7bd0e33989 (patch)
treeba390f42ebb7149e91c3494bc6a4ef3ac919ae22 /src/gui/sell.cpp
parentfbf19c2cdde592b126fe91c0dfff480f1318f50c (diff)
downloadmana-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.cpp13
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();