From de90520de303659fe639794544c2e19d462b3907 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 26 Jul 2018 03:02:37 +0300 Subject: Add support for changed item id size in packets. From some packet version hercules support item id fields as int32. --- src/net/eathena/markethandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/net/eathena/markethandler.cpp') 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 &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"); } } -- cgit v1.2.3-60-g2f50