1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2024-11-16 07:30:17 +01:00

Fix /outset and /inset to conform to WE standards

This commit is contained in:
Daniel Sosa 2015-02-16 02:47:21 +00:00
parent 1d372f7ed5
commit d4de7df263

View File

@ -2,11 +2,11 @@ dofile(minetest.get_modpath("worldedit_commands") .. "/cuboidapi.lua")
minetest.register_chatcommand("/outset", { minetest.register_chatcommand("/outset", {
params = "<amount> [h|v]", params = "[h|v] <amount>",
description = "outset the selection", description = "outset the selection",
privs = {worldedit=true}, privs = {worldedit=true},
func = function(name, param) func = function(name, param)
local find, _, amount, dir = param:find("^(%d+)[%s+]?([hv]?)$") local find, _, dir, amount = param:find("([hv]?)%s*([+-]?%d+)")
if find == nil then if find == nil then
return false, "invalid usage: " .. param return false, "invalid usage: " .. param
@ -42,11 +42,11 @@ minetest.register_chatcommand("/outset", {
minetest.register_chatcommand("/inset", { minetest.register_chatcommand("/inset", {
params = "<amount> [h|v]", params = "[h|v] <amount>",
description = "inset the selection", description = "inset the selection",
privs = {worldedit=true}, privs = {worldedit=true},
func = function(name, param) func = function(name, param)
local find, _, amount, dir = param:find("^(%d+)[%s+]?([hv]?)$") local find, _, dir, amount = param:find("([hv]?)%s*([+-]?%d+)")
if find == nil then if find == nil then
return false, "invalid usage: " .. param return false, "invalid usage: " .. param