diff --git a/moremesecons_luacontroller_tool/init.lua b/moremesecons_luacontroller_tool/init.lua index 82502f6..c85cbc6 100644 --- a/moremesecons_luacontroller_tool/init.lua +++ b/moremesecons_luacontroller_tool/init.lua @@ -49,7 +49,11 @@ local function save() end) end -minetest.register_on_shutdown(save_to_file) +minetest.register_on_shutdown(function() + if saving then + save_to_file() + end +end) -- test if it works