forked from minetest-mods/global_exchange
fix mistakes in exchange.lua and fix style in exchange_machine.lua
This commit is contained in:
parent
ac6b6c13e5
commit
d0ab05815b
@ -819,7 +819,7 @@ function ex_methods.buy(self, p_name, ex_name, item_name, amount, rate)
|
||||
return false, log2_err
|
||||
end
|
||||
|
||||
break
|
||||
remaining = 0
|
||||
end
|
||||
|
||||
if remaining == 0 then break end
|
||||
@ -983,8 +983,7 @@ function ex_methods.sell(self, p_name, ex_name, item_name, amount, rate)
|
||||
return false, log2_err
|
||||
end
|
||||
|
||||
break
|
||||
--revenue = revenue + remaining * row.Rate
|
||||
remaining = 0
|
||||
end
|
||||
|
||||
if remaining == 0 then break end
|
||||
|
@ -161,8 +161,8 @@ local function mk_main_fs(p_name, new_item, err_str, success)
|
||||
end
|
||||
|
||||
|
||||
local function show_main(p_name, ...)
|
||||
minetest.show_formspec(p_name, main_form, mk_main_fs(p_name, ...))
|
||||
local function show_main(p_name, new_item, err_str, success)
|
||||
minetest.show_formspec(p_name, main_form, mk_main_fs(p_name, new_item, err_str, success))
|
||||
end
|
||||
|
||||
|
||||
@ -220,6 +220,7 @@ end)
|
||||
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
-- the inventory list name is "p_"..player_name
|
||||
minetest.get_inventory({
|
||||
type="detached",
|
||||
name="global_exchange"
|
||||
|
Loading…
Reference in New Issue
Block a user