diff --git a/src/otclient/core/item.cpp b/src/otclient/core/item.cpp index 7f939e4d..abf5a0d6 100644 --- a/src/otclient/core/item.cpp +++ b/src/otclient/core/item.cpp @@ -73,7 +73,10 @@ void Item::draw(const Point& dest, float scaleFactor, bool animate) yPattern = m_position.y % getNumPatternsY(); zPattern = m_position.z % getNumPatternsZ(); } else if(isStackable() && getNumPatternsX() == 4 && getNumPatternsY() == 2) { - if(m_countOrSubType < 5) { + if(m_countOrSubType <= 0) { + xPattern = 0; + yPattern = 0; + } else if(m_countOrSubType < 5) { xPattern = m_countOrSubType-1; yPattern = 0; } else if(m_countOrSubType < 10) { diff --git a/src/otclient/net/protocolgameparse.cpp b/src/otclient/net/protocolgameparse.cpp index 8072e05d..a7cff165 100644 --- a/src/otclient/net/protocolgameparse.cpp +++ b/src/otclient/net/protocolgameparse.cpp @@ -506,8 +506,11 @@ void ProtocolGame::parseOpenNpcTrade(InputMessage& msg) std::vector> items; int listCount = msg.getU8(); for(int i = 0; i < listCount; ++i) { - ItemPtr item = Item::create(msg.getU16()); - item->setCountOrSubType(msg.getU8()); + uint16 itemId = msg.getU16(); + uint8 count = msg.getU8(); + + ItemPtr item = Item::create(itemId); + item->setCountOrSubType(count); std::string name = msg.getString(); int weight = msg.getU32();