mirror of
https://github.com/MinetestForFun/minercantile.git
synced 2024-12-23 16:20:22 +01:00
Update shop.lua
This commit is contained in:
parent
87335c6f80
commit
09d48dc614
8
shop.lua
8
shop.lua
@ -240,9 +240,11 @@ function minercantile.buy(name, item, nb, price)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local item_can_sell = nb
|
local item_can_sell = nb
|
||||||
if items_nb/4 < nb then
|
if items_nb < 4 then
|
||||||
item_can_sell = math.floor(items_nb/4)
|
item_can_sell = 1
|
||||||
end
|
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 price_total = math.floor(item_can_sell * price)
|
||||||
local player_can_buy = item_can_sell
|
local player_can_buy = item_can_sell
|
||||||
|
Loading…
Reference in New Issue
Block a user