Fix issues form code review
This commit is contained in:
parent
bb0b2d2f71
commit
41aceb83aa
|
@ -123,7 +123,7 @@ Set the param2 value of all nodes in the current WorldEdit region to `<param2>`.
|
|||
|
||||
### `//mix <node1> [<count1>] <node2> [<count2>]...`
|
||||
|
||||
Fill the current WorldEdit region with a random mix of `<node1>`, `<node2>`, `...`. Weightings can be optionally spsecified via a number after a node name.
|
||||
Fill the current WorldEdit region with a random mix of `<node1>`, `<node2>`, `...`. Weightings can be optionally specified via a number after a node name.
|
||||
|
||||
//mix air
|
||||
//mix cactus stone glass sandstone
|
||||
|
|
|
@ -431,11 +431,9 @@ minetest.register_chatcommand("/mix", {
|
|||
func = safe_region(function(name, param)
|
||||
local nodes = {}
|
||||
for nodename in param:gmatch("[^%s]+") do
|
||||
if tonumber(nodename) ~= nil then
|
||||
if tonumber(nodename) ~= nil and #nodes > 0 then
|
||||
local last_node = nodes[#nodes]
|
||||
local node_count = tonumber(nodename)
|
||||
minetest.log("action", "last node: " .. last_node .. ", count: " .. node_count)
|
||||
|
||||
for i=1,node_count do
|
||||
nodes[#nodes + 1] = last_node
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue