Show team name in global channel

This commit is contained in:
rubenwardy 2015-07-27 18:34:33 +01:00
parent 3cebef3471
commit cd3bd99f3b

View File

@ -232,7 +232,7 @@ minetest.register_chatcommand("all", {
return return
end end
if ctf.player(name) and ctf.player(name).team then if ctf.player(name).team then
minetest.chat_send_all(ctf.player(name).team .. " <" .. minetest.chat_send_all(ctf.player(name).team .. " <" ..
name .. "> " .. param) name .. "> " .. param)
else else
@ -268,17 +268,26 @@ minetest.register_chatcommand("t", {
-- Chat plus stuff -- Chat plus stuff
if chatplus then if chatplus then
chatplus.register_handler(function(from, to, msg) chatplus.register_handler(function(from, to, msg)
if not ctf.setting("chat.team_channel") or if not ctf.setting("chat.team_channel") then
ctf.setting("chat.default") ~= "team" then
-- Send to global -- Send to global
return nil return nil
end end
if ctf.setting("chat.default") ~= "team" then
if ctf.player(from).team then
minetest.chat_send_player(to, ctf.player(from).team ..
"<" .. from .. "> " .. msg)
return false
else
return nil
end
end
-- Send to team -- Send to team
local fromp = ctf.player(from) local fromp = ctf.player(from)
local top = ctf.player(to) local top = ctf.player(to)
if not fromp then if not fromp.team then
if not ctf.setting("chat.global_channel") then if not ctf.setting("chat.global_channel") then
-- Send to global -- Send to global
return nil return nil