Add sell all button to NPC trade

This commit is contained in:
Eduardo Bart
2013-02-15 16:38:57 -02:00
parent 28cdd6aa53
commit 67fc77d507
6 changed files with 65 additions and 18 deletions

View File

@@ -698,9 +698,14 @@ void ProtocolGame::parsePlayerGoods(const InputMessagePtr& msg)
int size = msg->getU8();
for(int i = 0; i < size; i++) {
int itemId = msg->getU16();
int count = msg->getU8();
int amount;
goods.push_back(std::make_tuple(Item::create(itemId), count));
if(g_game.getFeature(Otc::GameDoubleShopSellAmount))
amount = msg->getU16();
else
amount = msg->getU8();
goods.push_back(std::make_tuple(Item::create(itemId), amount));
}
g_game.processPlayerGoods(money, goods);