forked from mtcontrib/factions
Save current version
This commit is contained in:
parent
48e70baa50
commit
c069828a28
@ -840,8 +840,9 @@ function factions.load()
|
|||||||
local raw_data = file:read("*a")
|
local raw_data = file:read("*a")
|
||||||
local current_version = misc_mod_data.data.factions_version
|
local current_version = misc_mod_data.data.factions_version
|
||||||
misc_mod_data.load()
|
misc_mod_data.load()
|
||||||
|
local old_version = misc_mod_data.data.factions_version
|
||||||
factions.factions = minetest.deserialize(raw_data)
|
factions.factions = minetest.deserialize(raw_data)
|
||||||
if current_version ~= misc_mod_data.data.factions_version or factions.is_old_file(factions.factions) then
|
if current_version ~= old_version or factions.is_old_file(factions.factions) then
|
||||||
if factions.convert(filename) then
|
if factions.convert(filename) then
|
||||||
minetest.after(5,
|
minetest.after(5,
|
||||||
function()
|
function()
|
||||||
@ -887,6 +888,7 @@ function factions.load()
|
|||||||
faction.onlineplayers = {}
|
faction.onlineplayers = {}
|
||||||
end
|
end
|
||||||
file:close()
|
file:close()
|
||||||
|
misc_mod_data.data.factions_version = current_version
|
||||||
misc_mod_data.save()
|
misc_mod_data.save()
|
||||||
end
|
end
|
||||||
factions_ip.load()
|
factions_ip.load()
|
||||||
|
Loading…
Reference in New Issue
Block a user