mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-27 01:23:45 +01:00
core/run_command: guard against invalid potential_changes
This commit is contained in:
parent
177aea02a8
commit
5baa72cf6f
@ -37,6 +37,10 @@ local function run_command(cmdname, options, player_name, paramtext)
|
||||
|
||||
if options.nodes_needed then
|
||||
local potential_changes = options.nodes_needed(player_name, wea_c.table.unpack(parse_result))
|
||||
if type(potential_changes) ~= "number" then
|
||||
worldedit.player_notify(player_name, "Error: The command '"..cmdname.."' returned a "..type(potential_changes).." instead of a number when asked how many nodes might be changed. Abort. This is a bug.")
|
||||
return
|
||||
end
|
||||
|
||||
local limit = wea_c.safe_region_limit_default
|
||||
if wea_c.safe_region_limits[player_name] then
|
||||
|
Loading…
Reference in New Issue
Block a user