request insecure env properly

This commit is contained in:
AFCMS 2021-07-20 00:52:23 +02:00
parent b0be851f2d
commit 17f1c4a4a5
2 changed files with 9 additions and 0 deletions

View file

@ -9,7 +9,12 @@ minetest.register_alias("mapgen_water_source", "air")
--Variables
local modpath = minetest.get_modpath("formspec_edit")
local insecure_env = minetest.request_insecure_environment()
if not insecure_env then
error("[formspec_editor] Cannot access insecure environment!")
end
local io = insecure_env.io
local update_time = tonumber(minetest.settings:get("formspec_editor.update_time")) or 0.2