From 918d27db1f2ea2197e95fc3fcf1340f69f8ec9d0 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Fri, 25 Dec 2015 14:21:16 +0100 Subject: [PATCH] dont save if its not necessary on shutdown --- moremesecons_luacontroller_tool/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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