fix privilege definition on older engines
This commit is contained in:
parent
dad5d4729d
commit
4d9630d8b0
29
init.lua
29
init.lua
@ -1,14 +1,27 @@
|
|||||||
creative = {}
|
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_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")
|
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user