Update shop.lua

This commit is contained in:
Cyberpangolin 2016-06-07 21:32:26 +02:00
parent 87335c6f80
commit 09d48dc614
1 changed files with 5 additions and 3 deletions

View File

@ -240,9 +240,11 @@ function minercantile.buy(name, item, nb, price)
end
local item_can_sell = nb
if items_nb/4 < nb then
item_can_sell = math.floor(items_nb/4)
end
if items_nb < 4 then
item_can_sell = 1
elseif items_nb/4 < nb then
item_can_sell = math.floor(items_nb/4)
end
local price_total = math.floor(item_can_sell * price)
local player_can_buy = item_can_sell