|
|
@ -29,6 +29,7 @@ function creative_regions:update_player(player) |
|
|
|
local areas_owner = false |
|
|
|
local areas_guest = false |
|
|
|
local areas_open = false |
|
|
|
local areas_individual_override = false |
|
|
|
|
|
|
|
-- skip for players with protection_bypass |
|
|
|
if minetest.check_player_privs(name, { protection_bypass=true }) then |
|
|
@ -37,7 +38,7 @@ function creative_regions:update_player(player) |
|
|
|
|
|
|
|
-- find active regions |
|
|
|
local current_regions = self.astore:get_areas_for_pos(pos, true, true) |
|
|
|
for astore_id, astore_area in pairs( current_areas ) do |
|
|
|
for astore_id, astore_area in pairs( current_regions ) do |
|
|
|
local id = "r"..tostring(astore_id) |
|
|
|
local size = creative_regions:get_region_size(astore_area) |
|
|
|
table.insert(current_regions_size, { ["id"]=id, ["size"]=size }) |
|
|
@ -71,10 +72,15 @@ function creative_regions:update_player(player) |
|
|
|
player_active_region_str = player_active_region_str .. "," .. region.id |
|
|
|
if creative_regions.region_privs[region.id] then |
|
|
|
creative_regions:add_privs_from_string(new_privs_table, creative_regions.region_privs[region.id]) |
|
|
|
if string.sub(region.id, 1, 1) == "a" then |
|
|
|
areas_individual_override = true |
|
|
|
end |
|
|
|
elseif string.sub(region.id, 1, 1) == "r" then |
|
|
|
creative_regions:add_privs_from_string(new_privs_table, default_privs) |
|
|
|
elseif string.sub(region.id, 1, 1) == "a" then |
|
|
|
creative_regions:add_privs_from_string(new_privs_table, areas_guest_privs) |
|
|
|
if not areas_individual_override then |
|
|
|
creative_regions:add_privs_from_string(new_privs_table, areas_guest_privs) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|