diff options
author | ShadowNinja <noreply@gmail.com> | 2013-10-29 12:38:12 -0400 |
---|---|---|
committer | ShadowNinja <noreply@gmail.com> | 2013-10-29 12:38:12 -0400 |
commit | 5b4cbe122feb0159f4c5e851e4b4006cd3c1b750 (patch) | |
tree | 4fcd9075385ef42e99f0df577edf699c0b11cb65 /pos.lua | |
parent | 0c20a1b616fb1bc72e6db9fad061b12ee044602a (diff) |
Fix crash when using /area_pos# with invalid arguments
Diffstat (limited to 'pos.lua')
-rw-r--r-- | pos.lua | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -41,7 +41,7 @@ minetest.register_chatcommand("area_pos1", { .." location or the one specified", privs = {}, func = function(name, param) - local pos = {} + local pos = nil local found, _, x, y, z = param:find( "^(-?%d+)[%s%,]+(-?%d+)[%s%,]+(-?%d+)$") if found then @@ -58,6 +58,7 @@ minetest.register_chatcommand("area_pos1", { else minetest.chat_send_player(name, "Invalid usage, see /help area_pos1") + return end pos = vector.round(pos) areas:setPos1(name, pos) @@ -73,7 +74,7 @@ minetest.register_chatcommand("area_pos2", { .." location or the one specified", privs = {}, func = function(name, param) - local pos = {} + local pos = nil local found, _, x, y, z = param:find( "^(-?%d+)[%s%,]+(-?%d+)[%s%,]+(-?%d+)$") if found then @@ -90,6 +91,7 @@ minetest.register_chatcommand("area_pos2", { else minetest.chat_send_player(name, "Invalid usage, see /help area_pos2") + return end pos = vector.round(pos) areas:setPos2(name, pos) |