Small fix

This commit is contained in:
Jean-Patrick Guerrero 2022-09-24 14:29:42 +02:00
parent 27ed1f02e6
commit 32594e7552

View File

@ -19,6 +19,12 @@ local function inv_fields(player, data, fields)
return return
end end
if fields.dd_sorting_method then
data.sort = tonumber(fields.dd_sorting_method)
elseif fields.sb_font_size then
data.font_size = tonumber(fields.sb_font_size:match"-?%d+$")
end
for field in pairs(fields) do for field in pairs(fields) do
if sub(field, 1, 4) == "btn_" then if sub(field, 1, 4) == "btn_" then
data.subcat = indexof(i3.categories, sub(field, 5)) data.subcat = indexof(i3.categories, sub(field, 5))
@ -128,9 +134,6 @@ local function inv_fields(player, data, fields)
elseif fields.sort then elseif fields.sort then
sort_inventory(player, data) sort_inventory(player, data)
elseif fields.dd_sorting_method then
data.sort = tonumber(fields.dd_sorting_method)
elseif fields.home then elseif fields.home then
if not data.home then if not data.home then
return msg(name, "No home set") return msg(name, "No home set")
@ -147,9 +150,6 @@ local function inv_fields(player, data, fields)
elseif fields.bag_rename then elseif fields.bag_rename then
data.bag_rename = true data.bag_rename = true
elseif fields.sb_font_size then
data.font_size = tonumber(fields.sb_font_size:match"-?%d+$")
elseif fields.confirm_rename then elseif fields.confirm_rename then
local bag = get_detached_inv("bag", name) local bag = get_detached_inv("bag", name)
local bagstack = bag:get_stack("main", 1) local bagstack = bag:get_stack("main", 1)
@ -428,7 +428,7 @@ core.register_on_player_receive_fields(function(player, formname, fields)
if formname == "i3_outdated" then if formname == "i3_outdated" then
return false, core.kick_player(name, return false, core.kick_player(name,
S"Come back when your Minetest client is up-to-date (www.minetest.net).") S"Your Minetest client needs updating (www.minetest.net)")
elseif formname ~= "" then elseif formname ~= "" then
return false return false
end end