From 9bf3338f82bfbd425debb2855d015c7bd0e33989 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sun, 17 Jul 2005 21:10:44 +0000 Subject: Added Item and Equipment class and made the appropriate places make use of them. Plus some cleanups. --- src/gui/sell.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/gui/sell.cpp') 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 @@ -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(); -- cgit v1.2.3-60-g2f50