X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_player.qc;h=8aaf68cda69dac1753364cfe1e84cd07c10129c3;hb=b0423598270855d5f0a3206d46f0ebf43182b411;hp=a749ec2def81b8b60c1faaf8b9bf55d4270fda0a;hpb=7c9209dca6c1a4796dc1567f836671dd9fd2f938;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index a749ec2de..8aaf68cda 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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)); } }