Update to arena_lib latest ingredient can_disable_teams

This commit is contained in:
marco_a 2024-02-12 01:04:19 +01:00
parent 0e610b883c
commit fc385088b4
2 changed files with 13 additions and 0 deletions

View File

@ -17,6 +17,7 @@ arena_lib.register_minigame("block_league", {
teams = { S("orange"), S("blue") },
teams_color_overlay = { "orange", "blue"},
can_disable_teams = true, -- For tutorial only
camera_offset = {
nil,
@ -102,6 +103,7 @@ dofile(srcpath .. "/arena_lib/arena_editor.lua")
dofile(srcpath .. "/arena_lib/on_celebration.lua")
dofile(srcpath .. "/arena_lib/on_change_spectated_target.lua")
dofile(srcpath .. "/arena_lib/on_death.lua")
dofile(srcpath .. "/arena_lib/on_enable.lua")
dofile(srcpath .. "/arena_lib/on_entering.lua")
dofile(srcpath .. "/arena_lib/on_leaving.lua")
dofile(srcpath .. "/arena_lib/on_prejoin.lua")

View File

@ -0,0 +1,11 @@
local S = minetest.get_translator("block_league")
arena_lib.on_enable("block_league", function(arena, p_name)
if not arena.teams_enabled and (arena.mode == 1 or arena.mode == 2) then
arena_lib.print_error(p_name, S("This mode forcibly requires teams to work!"))
elseif arena.teams_enabled and arena.mode == 0 then
arena_lib.print_error(p_name, S("This mode forcibly requires no teams to work!"))
end
return true
end)