summaryrefslogtreecommitdiff
path: root/src/net/eathena/buysellrecv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/buysellrecv.cpp')
-rw-r--r--src/net/eathena/buysellrecv.cpp6
1 files changed, 4 insertions, 2 deletions
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<ItemTypeT>(
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);
}