summaryrefslogtreecommitdiff
path: root/worldedit_commands/safe.lua
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2015-05-16 19:52:11 -0400
committerShadowNinja <shadowninja@minetest.net>2015-05-16 19:52:48 -0400
commit163dffccb38a1f4e37866d7232cecfb5238f7af7 (patch)
tree0d722faca345e1cb43d504d4ede90e8b0fdb6834 /worldedit_commands/safe.lua
parent6b2fe397e6649fd64ad359e229e5a5e4eb0bafcc (diff)
Fix leaking {safe,check}_region
Diffstat (limited to 'worldedit_commands/safe.lua')
-rw-r--r--worldedit_commands/safe.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua
index c6751c1..e640853 100644
--- a/worldedit_commands/safe.lua
+++ b/worldedit_commands/safe.lua
@@ -1,7 +1,7 @@
local safe_region_callback = {}
local safe_region_param = {}
-check_region = function(name, param)
+local function check_region(name, param)
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] --obtain positions
if pos1 == nil or pos2 == nil then
worldedit.player_notify(name, "no region selected")
@@ -12,7 +12,7 @@ end
--`callback` is a callback to run when the user confirms
--`nodes_needed` is a function accepting `param`, `pos1`, and `pos2` to calculate the number of nodes needed
-safe_region = function(callback, nodes_needed)
+local function safe_region(callback, nodes_needed)
--default node volume calculation
nodes_needed = nodes_needed or check_region
@@ -63,3 +63,6 @@ minetest.register_chatcommand("/n", {
safe_region_callback[name], safe_region_param[name] = nil, nil
end,
})
+
+return safe_region, check_region
+