Fix formname warning

This commit is contained in:
Aaron Suen 2024-08-15 08:37:46 -04:00
parent eb6444605c
commit 74cf83dfb9

View File

@ -5,6 +5,8 @@ local math_ceil, string_find, string_lower, string_sub, table_sort
= math.ceil, string.find, string.lower, string.sub, table.sort
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local function invform() return "" end
if klots.editmode then
@ -68,10 +70,11 @@ if klots.editmode then
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname == "" and fields.search and not (fields.scroll
if (formname == "" or formname == modname)
and fields.search and not (fields.scroll
and string_sub(fields.scroll, 1, 4) == "CHG:") then
return minetest.show_formspec(player:get_player_name(),
"", invform(fields.search))
modname, invform(fields.search))
end
end)
end