From: Samual Lenks Date: Fri, 5 Oct 2012 02:35:38 +0000 (-0400) Subject: Add "dedicated_print" function, which only prints on dedicated servers X-Git-Tag: xonotic-v0.7.0~62^2~23^2~385 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d48ececcf43b620c6d9d9d82ec4a74af95e58d83;p=xonotic%2Fxonotic-data.pk3dir.git Add "dedicated_print" function, which only prints on dedicated servers --- diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index cbec4f5ea..d582540c0 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -1033,7 +1033,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f else if(teamsay > 0) // team message, only sent to team mates { sprint(source, sourcemsgstr); - //print(msgstr); // send to server console too + dedicated_print(msgstr); // send to server console too if(sourcecmsgstr != "") centerprint(source, sourcecmsgstr); FOR_EACH_REALPLAYER(head) if(head.team == source.team) @@ -1047,7 +1047,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f else if(teamsay < 0) // spectator message, only sent to spectators { sprint(source, sourcemsgstr); - //print(msgstr); // send to server console too + dedicated_print(msgstr); // send to server console too FOR_EACH_REALCLIENT(head) if(head.classname != "player") if(head != source) sprint(head, msgstr); @@ -1055,7 +1055,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f else if(sourcemsgstr != msgstr) // trimmed/server fixed message, sent to all players { sprint(source, sourcemsgstr); - //print(msgstr); // send to server console too + dedicated_print(msgstr); // send to server console too FOR_EACH_REALCLIENT(head) if(head != source) sprint(head, msgstr); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index b32dec366..13f393078 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -2707,3 +2707,8 @@ float isPushable(entity e) return TRUE; return FALSE; } + +void dedicated_print(string input) // print(), but only print if the server is not local +{ + if not(server_is_local) { print(input); } +} diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 0b1849678..1ed74d5b5 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -949,7 +949,7 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist ctf_worldflaglist = flag; - setattachment(flag, world, ""); + setattachment(flag, world, ""); flag.netname = ((teamnumber) ? "^1REPLACETHIS^7" : "^4REPLACETHIS^7"); // ((teamnumber) ? "^1RED^7 flag" : "^4BLUE^7 flag"); flag.team = ((teamnumber) ? FL_TEAM_1 : FL_TEAM_2); // FL_TEAM_1: color 4 team (red) - FL_TEAM_2: color 13 team (blue)