Chat command regex tweaks

This commit is contained in:
ShadowNinja
2013-11-14 19:15:26 -05:00
parent db664d68f8
commit 790ed15594
2 changed files with 7 additions and 7 deletions

View File

@ -44,7 +44,7 @@ minetest.register_chatcommand("area_pos1", {
func = function(name, param)
local pos = nil
local found, _, x, y, z = param:find(
"^(-?%d+)[%s%,]+(-?%d+)[%s%,]+(-?%d+)$")
"^(-?%d+)[, ](-?%d+)[, ](-?%d+)$")
if found then
pos = {x=tonumber(x), y=tonumber(y), z=tonumber(z)}
elseif param == "" then
@ -77,7 +77,7 @@ minetest.register_chatcommand("area_pos2", {
func = function(name, param)
local pos = nil
local found, _, x, y, z = param:find(
"^(-?%d+)[%s%,]+(-?%d+)[%s%,]+(-?%d+)$")
"^(-?%d+)[, ](-?%d+)[, ](-?%d+)$")
if found then
pos = {x=tonumber(x), y=tonumber(y), z=tonumber(z)}
elseif param == "" then