//spiral2: fix crash in parser

This commit is contained in:
Starbeamrainbowlabs 2021-10-31 19:48:51 +00:00
parent 33a2ff1ed4
commit ea8a91568e
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2

@ -36,21 +36,21 @@ worldedit.register_command("spiral2", {
if #parts >= 1 then
interval = tonumber(parts[1])
if not interval then
return false, "Error: Invalid interval value '"..parts[1].."'. Interval values must be integers."
return false, "Error: Invalid interval value '"..tostring(parts[1]).."'. Interval values must be integers."
end
table.remove(parts, 1)
end
if #parts >= 1 then
acceleration = tonumber(parts[1])
if not acceleration then
return false, "Error: Invalid acceleration value '"..parts[1].."'. Acceleration values must be integers."
return false, "Error: Invalid acceleration value '"..tostring(parts[1]).."'. Acceleration values must be integers."
end
table.remove(parts, 1)
end
local target_node_norm = worldedit.normalize_nodename(target_node)
if not target_node_norm then
return false, "Error: Unknown node '"..target_node_norm.."'."
return false, "Error: Unknown node '"..tostring(target_node).."'."
end
return true, mode, target_node_norm, interval, acceleration