diff options
author | sfan5 <sfan5@live.de> | 2017-01-31 19:52:54 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2017-01-31 19:52:54 +0100 |
commit | bcac45a476577341b6385b671edcf639acc63393 (patch) | |
tree | 51b2649f2512d1e70c66d4926914f14d534664f9 /worldedit_commands/safe.lua | |
parent | 426f3b949fc48862f3b9b8368aa33147c805142b (diff) |
Fix "safe region" functionality errornously rejecting pos1-only commands (e.g. //sphere)
Diffstat (limited to 'worldedit_commands/safe.lua')
-rw-r--r-- | worldedit_commands/safe.lua | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index e640853..a93e393 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -30,6 +30,10 @@ local function safe_region(callback, nodes_needed) end
end
+local function reset_pending(name)
+ safe_region_callback[name], safe_region_param[name] = nil, nil
+end
+
minetest.register_chatcommand("/y", {
params = "",
description = "Confirm a pending operation",
@@ -40,15 +44,8 @@ minetest.register_chatcommand("/y", { return
end
- --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
- end
-
safe_region_callback[name], safe_region_param[name] = nil, nil --reset pending operation
- callback(name, param, pos1, pos2)
+ callback(name, param)
end,
})
@@ -64,5 +61,5 @@ minetest.register_chatcommand("/n", { end,
})
-return safe_region, check_region
+return safe_region, check_region, reset_pending
|