fix mistakes in exchange.lua and fix style in exchange_machine.lua

This commit is contained in:
HybridDog 2016-03-09 19:00:04 +01:00
parent ac6b6c13e5
commit d0ab05815b
2 changed files with 5 additions and 5 deletions

View File

@ -819,7 +819,7 @@ function ex_methods.buy(self, p_name, ex_name, item_name, amount, rate)
return false, log2_err return false, log2_err
end end
break remaining = 0
end end
if remaining == 0 then break 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 return false, log2_err
end end
break remaining = 0
--revenue = revenue + remaining * row.Rate
end end
if remaining == 0 then break end if remaining == 0 then break end

View File

@ -161,8 +161,8 @@ local function mk_main_fs(p_name, new_item, err_str, success)
end end
local function show_main(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, ...)) minetest.show_formspec(p_name, main_form, mk_main_fs(p_name, new_item, err_str, success))
end end
@ -220,6 +220,7 @@ end)
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
-- the inventory list name is "p_"..player_name
minetest.get_inventory({ minetest.get_inventory({
type="detached", type="detached",
name="global_exchange" name="global_exchange"