1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-01-26 01:30:29 +01:00

Fixed area size for megabuilders

This commit is contained in:
Le_Docteur 2015-06-04 18:00:37 +02:00
parent cc7e126c7a
commit 94a11a598e

View File

@ -117,13 +117,15 @@ function areas:canPlayerAddArea(pos1, pos2, name)
end end
-- Check self protection privilege, if it is enabled, -- Check self protection privilege, if it is enabled,
-- and if the area is too big.
if not self.config.self_protection or if not self.config.self_protection or
not privs[areas.config.self_protection_privilege] then not privs[areas.config.self_protection_privilege] then
return false, "Self protection is disabled or you do not have" return false, "Self protection is disabled or you do not have"
.." the necessary privilege." .." the necessary privilege."
end end
-- MFF: megabuilders skip checks on size and number of areas.
if not privs["megabuilder"] then
-- Check size
local max_size = privs.areas_high_limit and local max_size = privs.areas_high_limit and
self.config.self_protection_max_size_high or self.config.self_protection_max_size_high or
self.config.self_protection_max_size self.config.self_protection_max_size
@ -144,10 +146,11 @@ function areas:canPlayerAddArea(pos1, pos2, name)
local max_areas = privs.areas_high_limit and local max_areas = privs.areas_high_limit and
self.config.self_protection_max_areas_high or self.config.self_protection_max_areas_high or
self.config.self_protection_max_areas self.config.self_protection_max_areas
if count >= max_areas and minetest.get_player_privs(name)["megabuilder"] ~= true then if count >= max_areas then
return false, "You have reached the maximum amount of" return false, "You have reached the maximum amount of"
.." areas that you are allowed to protect." .." areas that you are allowed to protect."
end end
end
-- Check intersecting areas -- Check intersecting areas
local can, id = self:canInteractInArea(pos1, pos2, name) local can, id = self:canInteractInArea(pos1, pos2, name)