From 92e1029b96aa5456589075a9cd7c054378e0ee27 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 9 Jan 2018 02:41:46 +0000 Subject: [PATCH] Defer ctf_stats.txt removal to reduce chance of loss of data --- mods/ctf_stats/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ctf_stats/init.lua b/mods/ctf_stats/init.lua index eeb2329..b62ea0c 100644 --- a/mods/ctf_stats/init.lua +++ b/mods/ctf_stats/init.lua @@ -11,7 +11,6 @@ function ctf_stats.load_legacy() local table = minetest.deserialize(file:read("*all")) file:close() - os.remove(minetest.get_worldpath() .. "/ctf_stats.txt") if type(table) ~= "table" then return false end @@ -50,6 +49,8 @@ function ctf_stats.load_legacy() } ctf.needs_save = true + + os.remove(minetest.get_worldpath() .. "/ctf_stats.txt") return true end