Defer ctf_stats.txt removal to reduce chance of loss of data
This commit is contained in:
parent
d46e705329
commit
92e1029b96
1 changed files with 2 additions and 1 deletions
|
@ -11,7 +11,6 @@ function ctf_stats.load_legacy()
|
||||||
|
|
||||||
local table = minetest.deserialize(file:read("*all"))
|
local table = minetest.deserialize(file:read("*all"))
|
||||||
file:close()
|
file:close()
|
||||||
os.remove(minetest.get_worldpath() .. "/ctf_stats.txt")
|
|
||||||
if type(table) ~= "table" then
|
if type(table) ~= "table" then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
@ -50,6 +49,8 @@ function ctf_stats.load_legacy()
|
||||||
}
|
}
|
||||||
|
|
||||||
ctf.needs_save = true
|
ctf.needs_save = true
|
||||||
|
|
||||||
|
os.remove(minetest.get_worldpath() .. "/ctf_stats.txt")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue