diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-26 03:02:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-26 22:01:35 +0300 |
commit | de90520de303659fe639794544c2e19d462b3907 (patch) | |
tree | 36b306a26e2c9dd422aede36f2f9ca3158ffbae2 /src/net/eathena/markethandler.cpp | |
parent | 45527f8597dfac68e914a798184282faeb1493f2 (diff) | |
download | mv-de90520de303659fe639794544c2e19d462b3907.tar.gz mv-de90520de303659fe639794544c2e19d462b3907.tar.bz2 mv-de90520de303659fe639794544c2e19d462b3907.tar.xz mv-de90520de303659fe639794544c2e19d462b3907.zip |
Add support for changed item id size in packets.
From some packet version hercules support item id fields as int32.
Diffstat (limited to 'src/net/eathena/markethandler.cpp')
-rw-r--r-- | src/net/eathena/markethandler.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp index 17e1bffd5..49ea4327c 100644 --- a/src/net/eathena/markethandler.cpp +++ b/src/net/eathena/markethandler.cpp @@ -75,7 +75,7 @@ void MarketHandler::buyItem(const int itemId, outMsg.writeInt16(CAST_S16(4 + 6 * cnt), "len"); for (int f = 0; f < cnt; f ++) { - outMsg.writeInt16(CAST_S16(itemId), "item id"); + outMsg.writeItemId(itemId, "item id"); outMsg.writeInt32(CAST_S16(amount2), "amount"); } } @@ -129,14 +129,15 @@ void MarketHandler::buyItems(const STD_VECTOR<ShopItem*> &items) const { for (int f = 0; f < usedQuantity; f ++) { - outMsg.writeInt16(CAST_S16(item->getId()), + outMsg.writeItemId(item->getId(), "item id"); outMsg.writeInt32(CAST_S16(1), "amount"); } } else { - outMsg.writeInt16(CAST_S16(item->getId()), "item id"); + outMsg.writeItemId(item->getId(), + "item id"); outMsg.writeInt32(CAST_S16(usedQuantity), "amount"); } } |