Ajoute infos privilège "megabuilder" dans la commande /area_info

This commit is contained in:
Sys Quatre 2019-12-28 15:07:13 +01:00
parent feae9967dc
commit 57f20bb25f
3 changed files with 11 additions and 7 deletions

View File

@ -403,7 +403,9 @@ minetest.register_chatcommand("area_info", {
elseif has_high_limit then
table.insert(lines,
"You have extended area protection"..
" limits (\"areas_high_limit\" privilege).")
" limits (\"areas_high_limit\" privilege).")
elseif privs.megabuilder then
table.insert(lines, "You are a megabuilder (\"megabuilder\" privilege).")
end
-- Area count
@ -415,7 +417,7 @@ minetest.register_chatcommand("area_info", {
end
local count_line = ("You have %d area%s"):format(
area_num, area_num == 1 and "" or "s")
if privs.areas then
if privs.areas or privs.megabuilder then
count_line = count_line..
" and have no area protection limits."
elseif can_prot then
@ -440,6 +442,8 @@ minetest.register_chatcommand("area_info", {
limit, size_limit)
priv_limit_info("areas_high_limit",
limit_high, size_limit_high)
elseif privs.megabuilder then
table.insert(lines, "You can protect areas unlimited in size and number.")
elseif has_prot_priv then
size_info("You can protect areas", max_size)
end
@ -448,4 +452,3 @@ minetest.register_chatcommand("area_info", {
return true, table.concat(lines, "\n")
end,
})

View File

@ -25,7 +25,11 @@ minetest.register_privilege("areas", {
description = "Can administer areas."
})
minetest.register_privilege("areas_high_limit", {
description = "Can can more, bigger areas."
description = "Can do more bigger areas."
})
-- Mega_builder privilege -- MFF
minetest.register_privilege("megabuilder", {
description = "Can protect an infinite amount of areas."
})
if not minetest.registered_privileges[areas.config.self_protection_privilege] then

View File

@ -1,6 +1,3 @@
-- Mega_builder privilege
minetest.register_privilege("megabuilder", "Can protect an infinite amount of areas.")
function areas:player_exists(name)
return minetest.get_auth_handler().get_auth(name) ~= nil
end