fix privilege definition on older engines

This commit is contained in:
mckaygerhard 2023-06-14 11:48:58 -04:00
parent dad5d4729d
commit 4d9630d8b0

View File

@ -1,14 +1,27 @@
creative = {}
minetest.register_privilege("creative", {
description = "Allow player to use creative inventory",
give_to_singleplayer = false,
give_to_admin = false
on_grant = update_sfinv,
on_revoke = update_sfinv,
})
local is_53 = minetest.has_feature("object_step_has_moveresult")
local is_50 = minetest.has_feature("object_use_texture_alpha")
local privs_description = "Allow player to use creative inventory"
local privs_definition = {}
if is_50 then
privs_definition = {
description = privs_description,
give_to_singleplayer = false,
give_to_admin = false,
on_grant = update_sfinv,
on_revoke = update_sfinv
}
else
privs_definition = {
description = privs_description,
give_to_singleplayer = false
}
end
minetest.register_privilege("creative", privs_definition)
local creative_mode_cache = minetest.settings:get_bool("creative_mode")