Add logging to /t

master
rubenwardy 2015-11-28 00:55:46 +00:00
parent b16d5c3b65
commit e672344383
2 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,8 @@
-- Get or add a team
function ctf.team(name)
if name == nil then
return nil
end
if type(name) == "table" then
if not name.add_team then
ctf.error("team", "Invalid table given to ctf.team")

View File

@ -251,13 +251,13 @@ minetest.register_chatcommand("t", {
return
end
if ctf.player(name).team then
local team = ctf.team(ctf.player(name).team)
if team then
for username, to in pairs(team.players) do
minetest.chat_send_player(username,
"<" .. name .. "> ** " .. param .. " **")
end
local tname = ctf.player(name).team
local team = ctf.team(tname)
if team then
minetest.log("action", tname .. "<" .. name .. "> ** ".. param .. " **")
for username, to in pairs(team.players) do
minetest.chat_send_player(username,
tname .. "<" .. name .. "> ** " .. param .. " **")
end
else
minetest.chat_send_player(name,