From 7b1deb1b61bc28b3e105833788eb07dfb1326984 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 17 Sep 2017 23:47:29 +0200 Subject: Add configurable brush item texture was supposed to be a brush, i suck at this :( --- worldedit_commands/safe.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'worldedit_commands/safe.lua') diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index a93e393..0bd30d7 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -1,6 +1,8 @@ local safe_region_callback = {} local safe_region_param = {} +worldedit._override_safe_regions = false -- internal use ONLY! + local function check_region(name, param) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] --obtain positions if pos1 == nil or pos2 == nil then @@ -20,7 +22,7 @@ local function safe_region(callback, nodes_needed) --check if the operation applies to a safe number of nodes local count = nodes_needed(name, param) if count == nil then return end --invalid command - if count < 10000 then + if worldedit._override_safe_regions or count < 10000 then return callback(name, param) end @@ -44,20 +46,21 @@ minetest.register_chatcommand("/y", { return end - safe_region_callback[name], safe_region_param[name] = nil, nil --reset pending operation + reset_pending(name) callback(name, param) end, }) minetest.register_chatcommand("/n", { params = "", - description = "Confirm a pending operation", + description = "Abort a pending operation", func = function(name) if not safe_region_callback[name] then worldedit.player_notify(name, "no operation pending") return end - safe_region_callback[name], safe_region_param[name] = nil, nil + + reset_pending(name) end, }) -- cgit v1.2.3