mirror of
https://github.com/minetest-mods/areas.git
synced 2025-06-30 15:10:28 +02:00
Centralize position getting and sorting
This commit is contained in:
12
pos.lua
12
pos.lua
@ -118,12 +118,12 @@ minetest.register_chatcommand("area_pos", {
|
||||
end,
|
||||
})
|
||||
|
||||
function areas:getPos1(playerName)
|
||||
return areas.pos1[playerName]
|
||||
end
|
||||
|
||||
function areas:getPos2(playerName)
|
||||
return areas.pos2[playerName]
|
||||
function areas:getPos(playerName)
|
||||
local pos1, pos2 = areas.pos1[playerName], areas.pos2[playerName]
|
||||
if not (pos1 and pos2) then
|
||||
return nil
|
||||
end
|
||||
return areas:sortPos(pos1, pos2)
|
||||
end
|
||||
|
||||
function areas:setPos1(playerName, pos)
|
||||
|
Reference in New Issue
Block a user