summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-02 13:15:13 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-02 13:29:11 +0200
commited907c859026ad2133858012b4798f7c074366c4 (patch)
tree6c1e0d878b8ee6f782b470a10c93b1411cc56247
parent42c63de10f16c7d12955b653fc2e3a7743799551 (diff)
downloadmana-client-ed907c859026ad2133858012b4798f7c074366c4.tar.gz
mana-client-ed907c859026ad2133858012b4798f7c074366c4.tar.bz2
mana-client-ed907c859026ad2133858012b4798f7c074366c4.tar.xz
mana-client-ed907c859026ad2133858012b4798f7c074366c4.zip
Fixed an inventory offset that I missed previously
When confirming item add for trade, the inventory offset was not substracted from the item index.
-rw-r--r--src/net/ea/inventoryhandler.cpp6
-rw-r--r--src/net/ea/tradehandler.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 79e7d2da..423d2e9c 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -353,8 +353,8 @@ void InventoryHandler::moveItem(StorageType source, int slot, int amount,
}
else if (source == STORAGE && destination == INVENTORY)
{
- MessageOut outMsg(CSMG_MOVE_FROM_STORAGE);
- outMsg.writeInt16(slot + STORAGE_OFFSET);
- outMsg.writeInt32(amount);
+ MessageOut outMsg(CSMG_MOVE_FROM_STORAGE);
+ outMsg.writeInt16(slot + STORAGE_OFFSET);
+ outMsg.writeInt32(amount);
}
}
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index 3a6ebe07..f711f3c4 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -166,7 +166,7 @@ void TradeHandler::handleMessage(MessageIn &msg)
case SMSG_TRADE_ITEM_ADD_RESPONSE:
// Trade: New Item add response (was 0x00ea, now 01b1)
{
- const int index = msg.readInt16();
+ const int index = msg.readInt16() - INVENTORY_OFFSET;
Item *item = player_node->getInventory()->getItem(index);
if (!item)
{
@@ -247,6 +247,7 @@ void TradeHandler::addItem(int slotNum, int amount)
void TradeHandler::removeItem(int slotNum, int amount)
{
+ // TODO
}
void TradeHandler::setMoney(int amount)
@@ -268,5 +269,5 @@ void TradeHandler::finish()
void TradeHandler::cancel()
{
- MessageOut outMsg(CMSG_TRADE_CANCEL_REQUEST);
+ MessageOut outMsg(CMSG_TRADE_CANCEL_REQUEST);
}