mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-25 10:10:41 +01:00
Fix some broken commands
This happens when you don't test.
This commit is contained in:
parent
9c38b9f6ad
commit
abdecd4239
@ -518,9 +518,9 @@ worldedit.register_command("set", {
|
|||||||
privs = {worldedit=true},
|
privs = {worldedit=true},
|
||||||
require_pos = 2,
|
require_pos = 2,
|
||||||
parse = function(param)
|
parse = function(param)
|
||||||
local node = worldedit.normalize_nodename(nodename)
|
local node = worldedit.normalize_nodename(param)
|
||||||
if not node then
|
if not node then
|
||||||
return false, "invalid node name: " .. nodename
|
return false, "invalid node name: " .. param
|
||||||
end
|
end
|
||||||
return true, node
|
return true, node
|
||||||
end,
|
end,
|
||||||
@ -636,7 +636,7 @@ local check_cube = function(param)
|
|||||||
if not node then
|
if not node then
|
||||||
return false, "invalid node name: " .. nodename
|
return false, "invalid node name: " .. nodename
|
||||||
end
|
end
|
||||||
return true, w, h, l, node
|
return true, tonumber(w), tonumber(h), tonumber(l), node
|
||||||
end
|
end
|
||||||
|
|
||||||
worldedit.register_command("hollowcube", {
|
worldedit.register_command("hollowcube", {
|
||||||
@ -678,7 +678,7 @@ local check_sphere = function(param)
|
|||||||
if not node then
|
if not node then
|
||||||
return false, "invalid node name: " .. nodename
|
return false, "invalid node name: " .. nodename
|
||||||
end
|
end
|
||||||
return true, radius, node
|
return true, tonumber(radius), node
|
||||||
end
|
end
|
||||||
|
|
||||||
worldedit.register_command("hollowsphere", {
|
worldedit.register_command("hollowsphere", {
|
||||||
@ -688,7 +688,7 @@ worldedit.register_command("hollowsphere", {
|
|||||||
require_pos = 1,
|
require_pos = 1,
|
||||||
parse = check_sphere,
|
parse = check_sphere,
|
||||||
nodes_needed = function(name, radius, node)
|
nodes_needed = function(name, radius, node)
|
||||||
return math.ceil((4 * math.pi * (tonumber(radius) ^ 3)) / 3) --volume of sphere
|
return math.ceil((4 * math.pi * (radius ^ 3)) / 3) --volume of sphere
|
||||||
end,
|
end,
|
||||||
func = function(name, radius, node)
|
func = function(name, radius, node)
|
||||||
local count = worldedit.sphere(worldedit.pos1[name], radius, node, true)
|
local count = worldedit.sphere(worldedit.pos1[name], radius, node, true)
|
||||||
@ -703,7 +703,7 @@ worldedit.register_command("sphere", {
|
|||||||
require_pos = 1,
|
require_pos = 1,
|
||||||
parse = check_sphere,
|
parse = check_sphere,
|
||||||
nodes_needed = function(name, radius, node)
|
nodes_needed = function(name, radius, node)
|
||||||
return math.ceil((4 * math.pi * (tonumber(radius) ^ 3)) / 3) --volume of sphere
|
return math.ceil((4 * math.pi * (radius ^ 3)) / 3) --volume of sphere
|
||||||
end,
|
end,
|
||||||
func = function(name, radius, node)
|
func = function(name, radius, node)
|
||||||
local count = worldedit.sphere(worldedit.pos1[name], radius, node)
|
local count = worldedit.sphere(worldedit.pos1[name], radius, node)
|
||||||
@ -720,7 +720,7 @@ local check_dome = function(param)
|
|||||||
if not node then
|
if not node then
|
||||||
return false, "invalid node name: " .. nodename
|
return false, "invalid node name: " .. nodename
|
||||||
end
|
end
|
||||||
return true, radius, node
|
return true, tonumber(radius), node
|
||||||
end
|
end
|
||||||
|
|
||||||
worldedit.register_command("hollowdome", {
|
worldedit.register_command("hollowdome", {
|
||||||
@ -730,7 +730,7 @@ worldedit.register_command("hollowdome", {
|
|||||||
require_pos = 1,
|
require_pos = 1,
|
||||||
parse = check_dome,
|
parse = check_dome,
|
||||||
nodes_needed = function(name, radius, node)
|
nodes_needed = function(name, radius, node)
|
||||||
return math.ceil((2 * math.pi * (tonumber(radius) ^ 3)) / 3) --volume of dome
|
return math.ceil((2 * math.pi * (radius ^ 3)) / 3) --volume of dome
|
||||||
end,
|
end,
|
||||||
func = function(name, radius, node)
|
func = function(name, radius, node)
|
||||||
local count = worldedit.dome(worldedit.pos1[name], radius, node, true)
|
local count = worldedit.dome(worldedit.pos1[name], radius, node, true)
|
||||||
@ -745,7 +745,7 @@ worldedit.register_command("dome", {
|
|||||||
require_pos = 1,
|
require_pos = 1,
|
||||||
parse = check_dome,
|
parse = check_dome,
|
||||||
nodes_needed = function(name, radius, node)
|
nodes_needed = function(name, radius, node)
|
||||||
return math.ceil((2 * math.pi * (tonumber(radius) ^ 3)) / 3) --volume of dome
|
return math.ceil((2 * math.pi * (radius ^ 3)) / 3) --volume of dome
|
||||||
end,
|
end,
|
||||||
func = function(name, radius, node)
|
func = function(name, radius, node)
|
||||||
local count = worldedit.dome(worldedit.pos1[name], radius, node)
|
local count = worldedit.dome(worldedit.pos1[name], radius, node)
|
||||||
|
Loading…
Reference in New Issue
Block a user