fix some items not being rendered in npc trade

This commit is contained in:
Eduardo Bart 2012-04-28 12:30:19 -03:00
parent 53bbde0b48
commit d3665efbb2
2 changed files with 9 additions and 3 deletions

View File

@ -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) {

View File

@ -506,8 +506,11 @@ void ProtocolGame::parseOpenNpcTrade(InputMessage& msg)
std::vector<std::tuple<ItemPtr, std::string, int, int, int>> 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();