|
|
@ -16,6 +16,19 @@ if minetest.get_modpath("areas") then |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
-- allow for players with areas privilege |
|
|
|
if not player_owns_id and minetest.check_player_privs(name, { areas=true }) then |
|
|
|
if table.getn(current_areas) == 1 |
|
|
|
player_owns_id = current_areas[1] or current_areas[0] |
|
|
|
else |
|
|
|
minetest.chat_send_player(name, "[creative_regions] Area ambiguous: You are in multiple areas.") |
|
|
|
minetest.after(0.2, function(pos) |
|
|
|
minetest.remove_node(pos) |
|
|
|
end, pos) |
|
|
|
return |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
if player_owns_id then |
|
|
|
if creative_regions.region_privs[player_owns_id] then |
|
|
|
minetest.chat_send_player(name, "[creative_regions] Failed. Privileges for area already set.") |
|
|
@ -95,6 +108,7 @@ if minetest.get_modpath("areas") then |
|
|
|
creative_regions.save_regions() |
|
|
|
else |
|
|
|
minetest.chat_send_player(name, "[creative_regions] Failed to remove privileges!") |
|
|
|
minetest.log("warning", "[creative_regions] Failed to remove privileges for "..description.." at "..dump(pos)) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|