diff --git a/mods/ctf_match/depends.txt b/mods/ctf_match/depends.txt index b82802d..7547079 100644 --- a/mods/ctf_match/depends.txt +++ b/mods/ctf_match/depends.txt @@ -3,3 +3,4 @@ ctf_flag ctf_inventory vote hudkit +irc? diff --git a/mods/ctf_match/init.lua b/mods/ctf_match/init.lua index f052e0b..8013e45 100644 --- a/mods/ctf_match/init.lua +++ b/mods/ctf_match/init.lua @@ -20,3 +20,15 @@ minetest.register_on_leaveplayer(function(player) ctf.remove_player(player:get_player_name()) end end) + +if minetest.global_exists("irc") then + ctf_match.register_on_winner(function(winner) + if not irc.connected then return end + irc:say("Team " .. winner .. " won!") + end) + + ctf.register_on_new_game(function() + if not irc.connected then return end + irc:say("Next round!") + end) +end diff --git a/mods/ctf_match/vote.lua b/mods/ctf_match/vote.lua index 20633dc..cf819ae 100644 --- a/mods/ctf_match/vote.lua +++ b/mods/ctf_match/vote.lua @@ -7,6 +7,11 @@ function ctf_match.register_on_skip_map(func) end function ctf_match.vote_next(name, params) + if minetest.global_exists("irc") then + local tname = ctf.player(name).team or "none" + irc:say("Vote started by " .. name .. " (team " .. tname .. ")") + end + return vote.new_vote(name, { description = "Skip to next match", help = "/yes, /no or /abstain",