Skip to content

Commit 2784a25

Browse files
committedMar 15, 2014
Fix region checking (thanks PenguinDad).
1 parent b29523d commit 2784a25

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
 

‎worldedit_commands/init.lua

-11
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ worldedit.player_axis = function(name)
7171
return "z", dir.z > 0 and 1 or -1
7272
end
7373

74-
local check_region = function(name, param)
75-
--obtain positions
76-
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
77-
if pos1 == nil or pos2 == nil then
78-
worldedit.player_notify(name, "no region selected")
79-
return nil
80-
end
81-
82-
return worldedit.volume(pos1, pos2)
83-
end
84-
8574
minetest.register_chatcommand("/about", {
8675
params = "",
8776
description = "Get information about the mod",

‎worldedit_commands/safe.lua

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ local safe_region_callback
22
local safe_region_name
33
local safe_region_param
44

5+
check_region = function(name, param)
6+
--obtain positions
7+
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
8+
if pos1 == nil or pos2 == nil then
9+
worldedit.player_notify(name, "no region selected")
10+
return nil
11+
end
12+
13+
return worldedit.volume(pos1, pos2)
14+
end
15+
516
--`callback` is a callback to run when the user confirms
617
--`nodes_needed` is a function accepting `param`, `pos1`, and `pos2` to calculate the number of nodes needed
718
safe_region = function(callback, nodes_needed)

0 commit comments

Comments
 (0)
Please sign in to comment.