mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-01-09 14:27:36 +01:00
Coding style updates.
This commit is contained in:
parent
420655bd94
commit
58d7a7134e
@ -25,11 +25,8 @@ end
|
||||
|
||||
--sets a region defined by positions `pos1` and `pos2` to `nodename`, returning the number of nodes filled
|
||||
worldedit.set = function(pos1, pos2, nodenames)
|
||||
local oneNode
|
||||
if type(nodenames) == 'string' then
|
||||
oneNode = true
|
||||
else
|
||||
oneNode = false
|
||||
if type(nodenames) == "string" then
|
||||
nodenames = {nodenames}
|
||||
end
|
||||
|
||||
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
|
||||
@ -51,7 +48,7 @@ worldedit.set = function(pos1, pos2, nodenames)
|
||||
for i,v in ipairs(nodenames) do
|
||||
node_ids[i] = minetest.get_content_id(nodenames[i])
|
||||
end
|
||||
if oneNode then --only one type of node
|
||||
if #node_ids then --only one type of node
|
||||
local id = node_ids
|
||||
for i in area:iterp(pos1, pos2) do nodes[i] = id end --fill area with node
|
||||
else --several types of nodes specified
|
||||
|
Loading…
Reference in New Issue
Block a user