1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2024-12-26 02:30:40 +01:00

Oops, fix //set.

This commit is contained in:
Uberi 2014-07-07 14:06:33 -04:00
parent 9616c7d944
commit b70fd16da4

View File

@ -50,14 +50,10 @@ worldedit.set = function(pos1, pos2, nodenames)
end end
if #node_ids == 1 then --only one type of node if #node_ids == 1 then --only one type of node
local id = node_ids[1] local id = node_ids[1]
for i in area:iterp(pos1, pos2) do for i in area:iterp(pos1, pos2) do nodes[i] = id end --fill area with node
nodes[i] = node_ids[id] else --several tpyes of nodes specified
end
else --fill randomly with all types of specified nodes
local id_count, rand = #node_ids, math.random local id_count, rand = #node_ids, math.random
for i in area:iterp(pos1, pos2) do for i in area:iterp(pos1, pos2) do nodes[i] = node_ids[rand(id_count)] end --fill randomly with all types of specified nodes
nodes[i] = node_ids[rand(id_count)]
end
end end
--update map nodes --update map nodes