CRASHFIX: flushing nonexistent arenas made the game crash
This commit is contained in:
parent
d1305be391
commit
a8af85a18b
@ -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
|
||||
|
||||
})
|
||||
|
@ -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!")))
|
||||
|
Loading…
x
Reference in New Issue
Block a user