diff options
author | Simon Edwardsson <simon@crossnet.se> | 2004-10-02 15:50:55 +0000 |
---|---|---|
committer | Simon Edwardsson <simon@crossnet.se> | 2004-10-02 15:50:55 +0000 |
commit | 91fbf564fe4a28a93122d6a8a6a1df9d119dce91 (patch) | |
tree | e1c8025714fb70c40f4e2e63117e1a86246f8b17 /src/gui/shop.cpp | |
parent | 572f377ea2eca51469e06109503e9f4bcb198166 (diff) | |
download | mana-91fbf564fe4a28a93122d6a8a6a1df9d119dce91.tar.gz mana-91fbf564fe4a28a93122d6a8a6a1df9d119dce91.tar.bz2 mana-91fbf564fe4a28a93122d6a8a6a1df9d119dce91.tar.xz mana-91fbf564fe4a28a93122d6a8a6a1df9d119dce91.zip |
Sell in shops does now works, and you can choose amount :) (hope I don't break anything)
Diffstat (limited to 'src/gui/shop.cpp')
-rw-r--r-- | src/gui/shop.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp index 3065f8ea..487465b6 100644 --- a/src/gui/shop.cpp +++ b/src/gui/shop.cpp @@ -26,6 +26,7 @@ #include "shop.h" int n_items; +char* selectedItem = "You got 4"; ITEM_SHOP *shop = NULL; char *item_db[] = { @@ -75,7 +76,9 @@ void add_sell_item(short index, int price) { else sprintf(item_shop->name, "Unknown item %i gp", price); item_shop->price = price; + item_shop->index = index; item_shop->id = id; + item_shop->quantity = inventory.items[index].quantity; item_shop->next = NULL; if(shop==NULL) shop = item_shop; @@ -107,3 +110,28 @@ short get_item_id(int index) { } return item_shop->id; } + +int get_item_quantity(int index) { + int iterator = 0; + ITEM_SHOP *item_shop = shop; + while(iterator<index) { + item_shop = item_shop->next; + iterator++; + } + return item_shop->quantity; +} +int get_item_index(int index) { + int iterator = 0; + ITEM_SHOP *item_shop = shop; + while(iterator<index) { + item_shop = item_shop->next; + iterator++; + } + return item_shop->index; +} + +void changeQ(void *dp3, int d2) +{ +sprintf(itemCurrenyQ,"%i",d2); +printf("%s\n",itemCurrenyQ); +}
\ No newline at end of file |