diff options
author | Uberi <azhang9@gmail.com> | 2014-07-07 14:06:33 -0400 |
---|---|---|
committer | Uberi <azhang9@gmail.com> | 2014-07-07 14:06:33 -0400 |
commit | b70fd16da4de759f86ab2c7b21d1c50361d7351d (patch) | |
tree | ea19bd0720aa817a9a846777753c05a19a541c24 /worldedit | |
parent | 9616c7d9445e05495b0d828a953e8460aec72cae (diff) |
Oops, fix `//set`.
Diffstat (limited to 'worldedit')
-rw-r--r-- | worldedit/manipulations.lua | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/worldedit/manipulations.lua b/worldedit/manipulations.lua index fb8506f..ee73a2d 100644 --- a/worldedit/manipulations.lua +++ b/worldedit/manipulations.lua @@ -50,14 +50,10 @@ worldedit.set = function(pos1, pos2, nodenames) end
if #node_ids == 1 then --only one type of node
local id = node_ids[1]
- for i in area:iterp(pos1, pos2) do
- nodes[i] = node_ids[id]
- end
- else --fill randomly with all types of specified nodes
+ for i in area:iterp(pos1, pos2) do nodes[i] = id end --fill area with node
+ else --several tpyes of nodes specified
local id_count, rand = #node_ids, math.random
- for i in area:iterp(pos1, pos2) do
- nodes[i] = node_ids[rand(id_count)]
- end
+ for i in area:iterp(pos1, pos2) do nodes[i] = node_ids[rand(id_count)] end --fill randomly with all types of specified nodes
end
--update map nodes
|