Add function callable by other mods to restore custom skybox (#3)

This commit is contained in:
auouymous 2022-01-02 12:41:24 -07:00 committed by GitHub
parent 7bb3e01547
commit 5086ec1256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,7 @@ end
-- registrations and load/save code
--
minetest.register_on_joinplayer(function(player)
skybox.restore = function(player)
local sky = player:get_meta():get_string("skybox:skybox")
if not sky or sky == "" then
skybox.clear(player)
@ -114,7 +114,8 @@ minetest.register_on_joinplayer(function(player)
end
skybox.clear(player)
end
end)
end
minetest.register_on_joinplayer(skybox.restore)
minetest.register_privilege("skybox", {
description = "Change sky box for yourself",