]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add "dedicated_print" function, which only prints on dedicated servers
authorSamual Lenks <samual@xonotic.org>
Fri, 5 Oct 2012 02:35:38 +0000 (22:35 -0400)
committerSamual Lenks <samual@xonotic.org>
Fri, 5 Oct 2012 02:35:38 +0000 (22:35 -0400)
qcsrc/server/cl_player.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_ctf.qc

index cbec4f5ea39a5ffa5eccfc8346aac35225a609e1..d582540c094d363205db33af43e548c9b00f05d7 100644 (file)
@@ -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);
index b32dec3660b704e8386a2e2118fc88f7926ec525..13f39307823d6b2862ff8ccbe7e8fc36fe09bbc9 100644 (file)
@@ -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); }
+}
index 0b18496786137806b391dad4d656989182a155c5..1ed74d5b577d0e862bd1921b93f96b5ebb1f98a0 100644 (file)
@@ -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)