diff --git a/src/commands.lua b/src/commands.lua index 9460e6e..e2c80a3 100755 --- a/src/commands.lua +++ b/src/commands.lua @@ -101,9 +101,7 @@ minetest.register_chatcommand("flusharena", { minetest.chat_send_player(sender, minetest.colorize("#e6482e", S("[!] Parameters don't seem right!"))) return end - local id, arena = arena_lib.get_arena_by_name(mod, arena_name) - - arena_lib.flush_arena(mod, arena, sender) + arena_lib.flush_arena(mod, arena_name, sender) end }) diff --git a/src/debug_utilities.lua b/src/debug_utilities.lua index 987ac44..333094e 100755 --- a/src/debug_utilities.lua +++ b/src/debug_utilities.lua @@ -254,7 +254,11 @@ end -function arena_lib.flush_arena(mod, arena, sender) +function arena_lib.flush_arena(mod, arena_name, sender) + + local id, arena = arena_lib.get_arena_by_name(mod, arena_name) + + if not ARENA_LIB_EDIT_PRECHECKS_PASSED(sender, arena) then return end if arena.in_queue or arena.in_game then minetest.chat_send_player(sender, minetest.colorize("#e6482e", S("[!] You can't perform this action during an ongoing game!")))