Skip to content

Commit

Permalink
Revert "Send kills to IRC channel"
Browse files Browse the repository at this point in the history
This reverts commit 460fd33.
  • Loading branch information
rubenwardy committed Dec 31, 2018
1 parent 86cb53e commit bdf4598
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
1 change: 0 additions & 1 deletion mods/ctf_events/depends.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ctf
ctf_match
hudkit
irc?
31 changes: 0 additions & 31 deletions mods/ctf_events/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,13 @@ ctf_events = {
events = {}
}

local emoji = {
kill_bullet = ",-",
kill_grenade = "o'",
kill_sword = "+--",
}

local function get_colorcodes(name)
if not name then
return "", ""
end
local color = ctf_colors.get_irc_color(ctf.player(name))
local clear = "\x0F"
if color then
color = "\x03" .. color
else
color = ""
clear = ""
end
return color, clear
end

function ctf_events.post(action, one, two)
table.insert(ctf_events.events, 1, {
action = action,
one = one,
two = two
})

if minetest.global_exists("irc") and emoji[action] then
local color1, clear1 = get_colorcodes(one)
local color2, clear2 = get_colorcodes(two)
local tag1 = one and (color1 .. "_" .. clear1) or ""
local tag2 = two and (color2 .. "_" .. clear2) or ""
local name1 = one and (tag1 .. one .. tag1) or ""
local name2 = two and (tag2 .. two .. tag2) or ""
irc.say((name1 .. " " .. emoji[action] .. " " .. name2):trim())
end

while #ctf_events.events > NUM_EVT do
table.remove(ctf_events.events, #ctf_events.events)
end
Expand Down

0 comments on commit bdf4598

Please sign in to comment.