From 285572e16be53294faa6ca5d32602ee01c2d5261 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 25 Sep 2022 01:19:36 +0100 Subject: [PATCH] saferegion: allow nodes_needed to return string --- worldeditadditions_core/core/run_command.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/worldeditadditions_core/core/run_command.lua b/worldeditadditions_core/core/run_command.lua index 67e1803..f5da612 100644 --- a/worldeditadditions_core/core/run_command.lua +++ b/worldeditadditions_core/core/run_command.lua @@ -37,9 +37,10 @@ local function run_command(cmdname, options, player_name, paramtext) if wea_c.safe_region_limits[player_name] then limit = wea_c.safe_region_limits[player_name] end - - if potential_changes > limit then - worldedit.player_notify(player_name, "/"..cmdname.." "..paramtext.."' may affect up to "..human_size(potential_changes).." nodes. Type //y to continue, or //n to cancel (see the //saferegion command to control when this message appears).") + if type(potential_changes) == "string" then + worldedit.player_notify(player_name, "/"..cmdname.." "..paramtext.." "..potential_changes..". Type //y to continue, or //n to cancel (in this specific situation, your configured limit via the //saferegion command does not apply).") + elseif potential_changes > limit then + worldedit.player_notify(player_name, "/"..cmdname.." "..paramtext.." may affect up to "..human_size(potential_changes).." nodes. Type //y to continue, or //n to cancel (see the //saferegion command to control when this message appears).") safe_region(player_name, cmdname, function() run_command_stage2(player_name, options.func, parse_result) end)