mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-28 03:30:39 +01:00
This commit is contained in:
parent
c2fafceb86
commit
6bba3ad794
10
pos.lua
10
pos.lua
@ -119,22 +119,22 @@ minetest.register_chatcommand("area_pos", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function areas.useWorldedit(playerName)
|
function areas.useWorldedit(playerName)
|
||||||
if worldedit or minetest.get_modpath("worldedit") then
|
if worldedit then
|
||||||
if nil == playerName then
|
if nil == playerName then
|
||||||
return true;
|
return true;
|
||||||
elseif minetest.check_player_privs(playerName, {worldedit = true}) then
|
elseif minetest.check_player_privs(playerName, {worldedit = true}) then
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
else
|
|
||||||
return false;
|
|
||||||
end
|
end
|
||||||
|
return false;
|
||||||
end
|
end
|
||||||
|
|
||||||
function areas:getPos(playerName)
|
function areas:getPos(playerName)
|
||||||
|
local pos1, pos2 = nil, nil;
|
||||||
if areas.useWorldedit(playerName) then
|
if areas.useWorldedit(playerName) then
|
||||||
local pos1, pos2 = worldedit.pos1[playerName], worldedit.pos2[playerName];
|
pos1, pos2 = worldedit.pos1[playerName], worldedit.pos2[playerName];
|
||||||
else
|
else
|
||||||
local pos1, pos2 = areas.pos1[playerName], areas.pos2[playerName];
|
pos1, pos2 = areas.pos1[playerName], areas.pos2[playerName];
|
||||||
end
|
end
|
||||||
|
|
||||||
if not (pos1 and pos2) then
|
if not (pos1 and pos2) then
|
||||||
|
Loading…
Reference in New Issue
Block a user