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 | |
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
-rw-r--r-- | src/game.cpp | 34 | ||||
-rw-r--r-- | src/net/protocol.cpp | 3 |
2 files changed, 35 insertions, 2 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); diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp index 92d1fae5..a11dad82 100644 --- a/src/net/protocol.cpp +++ b/src/net/protocol.cpp @@ -75,7 +75,8 @@ short packet_lengths[] = { 30, 8, 34, 14, 2, 6, 26, 2, 28, 81, 6, 10, 26, 2, -1, -1, -1, -1, 20, 10, 32, 9, 34, 14, 2, 6, 48, 56, -1, 4, 5, 10, // #0x200 - 26, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, + 26, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; short get_length(short id) { |