From 6fd6c9b0df88f1a525f829f6b382432b695473a5 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 14 Jul 2015 16:10:26 +0100 Subject: [PATCH] Don't show log message if player doesn't actually view flag board --- mods/capturetheflag/ctf_flag/gui.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mods/capturetheflag/ctf_flag/gui.lua b/mods/capturetheflag/ctf_flag/gui.lua index 756340f..3557443 100644 --- a/mods/capturetheflag/ctf_flag/gui.lua +++ b/mods/capturetheflag/ctf_flag/gui.lua @@ -68,8 +68,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end) -- Flag interface -function ctf.gui.flag_board(name,pos) - ctf.log("gui", name .. " views flag board") +function ctf.gui.flag_board(name, pos) local flag = ctf_flag.get(pos) if not flag then return @@ -80,13 +79,15 @@ function ctf.gui.flag_board(name,pos) return end - if ctf.can_mod(name,team) == false then - if ctf.player(name) and ctf.player(name).team and ctf.player(name).team == team then - ctf.gui.show(name, "news") + if not ctf.can_mod(name, team) then + if ctf.player(name).team and ctf.player(name).team == team then + ctf.gui.show(name) end return end + ctf.log("gui", name .. " views flag board") + local flag_name = flag.name if not ctf.setting("flag.names") then