mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 09:03:01 +00:00
bonemeal: tidy up split_shell call
This commit is contained in:
parent
f1a433b5e3
commit
75ffa81b7e
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
local we_c = worldeditadditions_commands
|
local we_c = worldeditadditions_commands
|
||||||
|
local wea = worldeditadditions
|
||||||
|
|
||||||
-- ██████ ██████ ███ ██ ███████ ███ ███ ███████ █████ ██
|
-- ██████ ██████ ███ ██ ███████ ███ ███ ███████ █████ ██
|
||||||
-- ██ ██ ██ ██ ████ ██ ██ ████ ████ ██ ██ ██ ██
|
-- ██ ██ ██ ██ ████ ██ ██ ████ ████ ██ ██ ██ ██
|
||||||
|
@ -15,14 +16,14 @@ worldedit.register_command("bonemeal", {
|
||||||
params_text = "1"
|
params_text = "1"
|
||||||
end
|
end
|
||||||
|
|
||||||
local parts = worldeditadditions.split_shell(params_text, "%s+", false)
|
local parts = wea.split_shell(params_text)
|
||||||
|
|
||||||
local strength = 1
|
local strength = 1
|
||||||
local chance = 1
|
local chance = 1
|
||||||
local node_names = {} -- An empty table means all nodes
|
local node_names = {} -- An empty table means all nodes
|
||||||
|
|
||||||
if #parts >= 1 then
|
if #parts >= 1 then
|
||||||
strength = tonumber(table.remove(parts, 1))
|
strength = tonumber(wea.trim(table.remove(parts, 1)))
|
||||||
if not strength then
|
if not strength then
|
||||||
return false, "Invalid strength value (value must be an integer)"
|
return false, "Invalid strength value (value must be an integer)"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue