mirror of
https://gitlab.com/rubenwardy/awards.git
synced 2024-11-16 23:50:27 +01:00
Save data at a regular interval
This commit is contained in:
parent
b769e93412
commit
3b785449fd
6
init.lua
6
init.lua
|
@ -29,6 +29,12 @@ end
|
||||||
awards.load()
|
awards.load()
|
||||||
minetest.register_on_shutdown(awards.save)
|
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
|
-- Backwards compatibility
|
||||||
awards.give_achievement = awards.unlock
|
awards.give_achievement = awards.unlock
|
||||||
|
|
Loading…
Reference in New Issue
Block a user