Skip to content

Commit

Permalink
be backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS committed Sep 16, 2024
1 parent b8e0f7d commit 25448cc
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions areas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@ end
-- protection check
local old_is_protected = minetest.is_protected
function minetest.is_protected(pos, name)
local _, id = areas:getSmallestAreaAtPos(pos)
if id then
local required_priv = priv_areas[id]
if required_priv and not minetest.check_player_privs(name, required_priv) then
-- required privililege not met, protected
return true
if areas.getSmallestAreaAtPos then
local _, id = areas:getSmallestAreaAtPos(pos)
if id then
local required_priv = priv_areas[id]
if required_priv and not minetest.check_player_privs(name, required_priv) then
-- required privililege not met, protected
return true
end
end
else
local area_list = areas:getAreasAtPos(pos)
for id in pairs(area_list) do
local required_priv = priv_areas[id]

if required_priv and not minetest.check_player_privs(name, required_priv) then
-- required privililege not met, protected
return true
end
end
end

Expand Down

0 comments on commit 25448cc

Please sign in to comment.