]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Merge branch 'terencehill/hud_skin_updates' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index a749ec2def81b8b60c1faaf8b9bf55d4270fda0a..8aaf68cda69dac1753364cfe1e84cd07c10129c3 100644 (file)
@@ -657,6 +657,12 @@ void MoveToTeam(entity client, int team_colour, int type)
        LogTeamchange(client.playerid, client.team, type);
 }
 
+/** print(), but only print if the server is not local */
+void dedicated_print(string input)
+{
+       if (server_is_dedicated) print(input);
+}
+
 /**
  * message "": do not say, just test flood control
  * return value:
@@ -857,8 +863,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
                sourcecmsgstr = cmsgstr;
        }
 
-       if(!privatesay)
-       if (!IS_PLAYER(source))
+       if (!privatesay && source && !IS_PLAYER(source))
        {
                if (!intermission_running)
                        if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(warmup_stage || gameover)))
@@ -933,15 +938,14 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
                        dedicated_print(msgstr); // send to server console too
                        FOREACH_CLIENT(!IS_PLAYER(it) && IS_REAL_CLIENT(it) && it != source, sprint(it, msgstr));
                }
-               else {
-            if (sourcemsgstr != msgstr) { // trimmed/server fixed message, sent to all players
+               else
+               {
+            if (source) {
                 sprint(source, sourcemsgstr);
                 dedicated_print(msgstr); // send to server console too
-                FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source, sprint(it, msgstr));
-            } else { // entirely normal message, sent to all players -- bprint sends to server console too.
-                bprint(msgstr);
+                MX_Say(strcat(playername(source), "^7: ", msgin));
             }
-            if (source) MX_Say(strcat(playername(source), "^7: ", msgin));
+            FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source, sprint(it, msgstr));
         }
        }