From 3b91c4d509f37fc61d339bf8a3c4c1b77ae2e771 Mon Sep 17 00:00:00 2001 From: BeniS Date: Thu, 21 Feb 2013 00:28:45 +1300 Subject: [PATCH] Minor quantity fix from previous commit --- modules/game_npctrade/npctrade.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/game_npctrade/npctrade.lua b/modules/game_npctrade/npctrade.lua index 2632431a..37315386 100644 --- a/modules/game_npctrade/npctrade.lua +++ b/modules/game_npctrade/npctrade.lua @@ -488,16 +488,19 @@ function checkSellAllTooltip() local first = true for key, amount in pairs(playerItems) do - if amount > 0 then - local data = getTradeItemData(key, SELL) - if data and canTradeItem(data) then - info = info..(not first and "\n" or "").. - amount.." ".. - data.name.." (".. - data.price*amount.." gold)" - - total = total+(data.price*amount) - if first then first = false end + local data = getTradeItemData(key, SELL) + if data then + amount = getSellQuantity(data.ptr) + if amount > 0 then + if data and amount > 0 then + info = info..(not first and "\n" or "").. + amount.." ".. + data.name.." (".. + data.price*amount.." gold)" + + total = total+(data.price*amount) + if first then first = false end + end end end end