From ebe17cc9e364993091f433d36898f86cede319d6 Mon Sep 17 00:00:00 2001 From: Cyberpangolin Date: Fri, 10 Jun 2016 22:52:26 +0200 Subject: [PATCH] Update price calculation to avoid big differences on very low prices. add 0.5 to the calculated buying price before rounding it to make it more balanced at very low prices. --- shop.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shop.lua b/shop.lua index e40e841..b01e045 100644 --- a/shop.lua +++ b/shop.lua @@ -203,7 +203,7 @@ function minercantile.shop.get_sell_price(itname, wear) if minercantile.stock.items[itname].price ~= nil then -- if defined price price = math.floor(minercantile.stock.items[itname].price) else - price = math.floor((money/10)/(math.log(nb+2000+99)*10)*1000000/(math.pow((nb+2000+99),(2.01)))) + price = math.floor(((money/10)/(math.log(nb+2000+99)*10)*1000000/(math.pow((nb+2000+99),(2.01))))+0.5) end if wear and wear > 0 then --calcul price with % wear, (0-65535)