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/buysellrecv.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/buysellrecv.cpp') diff --git a/src/net/eathena/buysellrecv.cpp b/src/net/eathena/buysellrecv.cpp index c49375fd3..9bb91520b 100644 --- a/src/net/eathena/buysellrecv.cpp +++ b/src/net/eathena/buysellrecv.cpp @@ -46,13 +46,15 @@ #include "debug.h" +extern int itemIdLen; + namespace EAthena { void BuySellRecv::processNpcBuy(Net::MessageIn &msg) { msg.readInt16("len"); - const int sz = 11; + const int sz = 9 + itemIdLen; const int n_items = (msg.getLength() - 4) / sz; const BeingTypeId npcId = NpcRecv::mNpcTypeId; @@ -83,7 +85,7 @@ void BuySellRecv::processNpcBuy(Net::MessageIn &msg) msg.readInt32("dc value?"); const ItemTypeT type = static_cast( msg.readUInt8("type")); - const int itemId = msg.readInt16("item id"); + const int itemId = msg.readItemId("item id"); const ItemColor color = ItemColor_one; Ea::BuySellRecv::mBuyDialog->addItem(itemId, type, color, 0, value); } -- cgit v1.2.3-70-g09d2