diff options
author | Jan-Fabian Humann <malastare@gmx.net> | 2005-05-21 13:19:01 +0000 |
---|---|---|
committer | Jan-Fabian Humann <malastare@gmx.net> | 2005-05-21 13:19:01 +0000 |
commit | cdc6aee6bf07b4db98b63e26df9a3bd0ce312e6a (patch) | |
tree | c5799eb0c48da9b70fbd81a6c04dcd13acd4ab32 /src/game.cpp | |
parent | b89398608993f2e50b7c7edd8aabe7cb1c1c216b (diff) | |
download | Mana-cdc6aee6bf07b4db98b63e26df9a3bd0ce312e6a.tar.gz Mana-cdc6aee6bf07b4db98b63e26df9a3bd0ce312e6a.tar.bz2 Mana-cdc6aee6bf07b4db98b63e26df9a3bd0ce312e6a.tar.xz Mana-cdc6aee6bf07b4db98b63e26df9a3bd0ce312e6a.zip |
first part of trade fix, second part will be serverside
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp index 717567d1..d4859b71 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -854,7 +854,39 @@ void do_parse() tradeWindow->partnerItems->getFreeSlot(), RFIFOW(6), false, RFIFOL(2), false); break; - // Trade: Item add response + // Trade: New Item add response + case 0x0215: + switch (RFIFOB(6)) { + case 0: + // Successfully added item + if (inventoryWindow->items->isEquipment(RFIFOW(2))) + { + if (inventoryWindow->items->isEquipped(RFIFOW(2))) + { + inventoryWindow->unequipItem(RFIFOW(2)); + } + } + tradeWindow->addItem( + tradeWindow->myItems->getFreeSlot(), + inventoryWindow->items->getId(RFIFOW(2)), + true, RFIFOW(4), + inventoryWindow->items->isEquipment( + RFIFOW(2))); + inventoryWindow->changeQuantity(RFIFOW(2), + (inventoryWindow->items->getQuantity(RFIFOW(2)) + - RFIFOW(4))); + 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"); + break; + } + break; + // Trade: Old Item add response case 0x00ea: tradeWindow->setTradeButton(false); //chatWindow->chat_log("add response got", BY_SERVER); |