diff options
author | Jan-Fabian Humann <malastare@gmx.net> | 2005-04-06 21:30:02 +0000 |
---|---|---|
committer | Jan-Fabian Humann <malastare@gmx.net> | 2005-04-06 21:30:02 +0000 |
commit | 22774c178e7bab484485bded6950e76c8fa54b00 (patch) | |
tree | e1acd405cc961ae8908ee92443567b96f51d0881 /src/game.cpp | |
parent | ccf84aa701dc938e7e390339c8ca5c2c7e5a21c5 (diff) | |
download | mana-22774c178e7bab484485bded6950e76c8fa54b00.tar.gz mana-22774c178e7bab484485bded6950e76c8fa54b00.tar.bz2 mana-22774c178e7bab484485bded6950e76c8fa54b00.tar.xz mana-22774c178e7bab484485bded6950e76c8fa54b00.zip |
Another trade update
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp index f4ecd0b7..2d773fc1 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -785,12 +785,30 @@ void do_parse() { break; } break; - // Trade: Item successfully added + // Trade: Item add response case 0x00ea: switch (RFIFOB(4)) { case 0: - //printf("Item successfully added\n"); - // Add code to be added + // Successfully added item + int ind = RFIFOW(2); + if (inventoryWindow->items->isEquipment(ind)) { + if (inventoryWindow->items->isEquipped(ind)) { + inventoryWindow->unequipItem(ind); + } + } + + tradeWindow->addItem( + tradeWindow->my_items->getFreeSlot(), + inventoryWindow->items->getId(ind), + true, + inventoryWindow->items->getQuantity(ind), + inventoryWindow->items->isEquipment(ind)); + inventoryWindow->changeQuantity(ind, 0); + break; + case 1: + // Add item failed - player overweighted + chatWindow->chat_log("Failed adding item. Trade partner is over weighted.", + BY_SERVER); break; default: //printf("Unhandled 0x00ea byte!\n"); |