Save data at a regular interval

This commit is contained in:
rubenwardy 2023-05-19 16:41:01 +01:00
parent b769e93412
commit 2b90b18fe9
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,12 @@ end
awards.load()
minetest.register_on_shutdown(awards.save)
local function check_save()
awards.save()
minetest.after(18, check_save)
end
minetest.after(8 * math.random() + 10, check_save)
-- Backwards compatibility
awards.give_achievement = awards.unlock