diff options
author | Uberi <azhang9@gmail.com> | 2014-03-15 14:28:47 -0400 |
---|---|---|
committer | Uberi <azhang9@gmail.com> | 2014-03-15 14:28:47 -0400 |
commit | 2784a25561be45894d2a138828013c96f387d470 (patch) | |
tree | 1edf63a33f7017eac032987a5ca622b77bb04838 /worldedit_commands | |
parent | b29523db4df4d793165672cda8adb3090d8b9ffe (diff) |
Fix region checking (thanks PenguinDad).
Diffstat (limited to 'worldedit_commands')
-rw-r--r-- | worldedit_commands/init.lua | 11 | ||||
-rw-r--r-- | worldedit_commands/safe.lua | 11 |
2 files changed, 11 insertions, 11 deletions
diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index e26d40c..2bbfeed 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -71,17 +71,6 @@ worldedit.player_axis = function(name) return "z", dir.z > 0 and 1 or -1
end
-local check_region = function(name, param)
- --obtain positions
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- if pos1 == nil or pos2 == nil then
- worldedit.player_notify(name, "no region selected")
- return nil
- end
-
- return worldedit.volume(pos1, pos2)
-end
-
minetest.register_chatcommand("/about", {
params = "",
description = "Get information about the mod",
diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index 6f83078..834462c 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -2,6 +2,17 @@ local safe_region_callback local safe_region_name
local safe_region_param
+check_region = function(name, param)
+ --obtain positions
+ local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
+ if pos1 == nil or pos2 == nil then
+ worldedit.player_notify(name, "no region selected")
+ return nil
+ end
+
+ return worldedit.volume(pos1, pos2)
+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)
|