mirror of
https://github.com/minetest-mods/areas.git
synced 2024-11-19 21:53:44 +01:00
trivial a -> an in comments
This commit is contained in:
parent
c2e3d073be
commit
6fd05bc95e
11
internal.lua
11
internal.lua
@ -92,7 +92,7 @@ local function findFirstUnusedIndex(t)
|
|||||||
return i
|
return i
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Add a area.
|
--- Add an area.
|
||||||
-- @return The new area's ID.
|
-- @return The new area's ID.
|
||||||
function areas:add(owner, name, pos1, pos2, parent)
|
function areas:add(owner, name, pos1, pos2, parent)
|
||||||
local id = findFirstUnusedIndex(self.areas)
|
local id = findFirstUnusedIndex(self.areas)
|
||||||
@ -118,8 +118,8 @@ function areas:add(owner, name, pos1, pos2, parent)
|
|||||||
return id
|
return id
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Remove a area, and optionally its children recursively.
|
--- Remove an area, and optionally its children recursively.
|
||||||
-- If a area is deleted non-recursively the children will
|
-- If an area is deleted non-recursively the children will
|
||||||
-- have the removed area's parent as their new parent.
|
-- have the removed area's parent as their new parent.
|
||||||
function areas:remove(id, recurse)
|
function areas:remove(id, recurse)
|
||||||
if recurse then
|
if recurse then
|
||||||
@ -136,7 +136,6 @@ function areas:remove(id, recurse)
|
|||||||
-- The subarea parent will be niled out if the
|
-- The subarea parent will be niled out if the
|
||||||
-- removed area does not have a parent
|
-- removed area does not have a parent
|
||||||
self.areas[cid].parent = parent
|
self.areas[cid].parent = parent
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -172,7 +171,7 @@ function areas:move(id, area, pos1, pos2)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Checks if a area between two points is entirely contained by another area.
|
-- Checks if an area between two points is entirely contained by another area.
|
||||||
-- Positions must be sorted.
|
-- Positions must be sorted.
|
||||||
function areas:isSubarea(pos1, pos2, id)
|
function areas:isSubarea(pos1, pos2, id)
|
||||||
local area = self.areas[id]
|
local area = self.areas[id]
|
||||||
@ -291,7 +290,7 @@ areas:registerProtectionCondition(function(pos1, pos2, name)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Given a id returns a string in the format:
|
-- Given an id returns a string in the format:
|
||||||
-- "name [id]: owner (x1, y1, z1) (x2, y2, z2) -> children"
|
-- "name [id]: owner (x1, y1, z1) (x2, y2, z2) -> children"
|
||||||
function areas:toString(id)
|
function areas:toString(id)
|
||||||
local area = self.areas[id]
|
local area = self.areas[id]
|
||||||
|
2
pos.lua
2
pos.lua
@ -4,7 +4,7 @@ local S = minetest.get_translator("areas")
|
|||||||
-- permission to use those commands and you don't have
|
-- permission to use those commands and you don't have
|
||||||
-- /area_pos{1,2} [X Y Z|X,Y,Z].
|
-- /area_pos{1,2} [X Y Z|X,Y,Z].
|
||||||
-- Since this is mostly copied from WorldEdit it is mostly
|
-- Since this is mostly copied from WorldEdit it is mostly
|
||||||
-- licensed under the AGPL. (select_area is a exception)
|
-- licensed under the AGPL. (select_area is an exception)
|
||||||
|
|
||||||
areas.marker1 = {}
|
areas.marker1 = {}
|
||||||
areas.marker2 = {}
|
areas.marker2 = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user