X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fchat.qc;h=a73de2a1f6c58f2ed97e4303ae5179a7354b07db;hb=6c02403a4e7bd15f1c4665857958a0081cca0ec8;hp=204ed13410defe587a59a540b5bc207a8787e295;hpb=b508390bc38d446e441ec990a1d34851251bd2cb;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/chat.qc b/qcsrc/server/chat.qc index 204ed1341..a73de2a1f 100644 --- a/qcsrc/server/chat.qc +++ b/qcsrc/server/chat.qc @@ -31,7 +31,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc msgin = formatmessage(source, msgin); string colorstr; - if (!(IS_PLAYER(source) || source.caplayer)) + if (!(IS_PLAYER(source) || INGAME(source))) colorstr = "^0"; // black for spectators else if(teamplay) colorstr = Team_ColorCode(source.team); @@ -224,7 +224,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc sourcecmsgstr = cmsgstr; } - if (!privatesay && source && !(IS_PLAYER(source) || source.caplayer) && !game_stopped + if (!privatesay && source && !(IS_PLAYER(source) || INGAME(source)) && !game_stopped && (teamsay || CHAT_NOSPECTATORS())) { teamsay = -1; // spectators @@ -258,8 +258,8 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc ret = 1; } - if (privatesay && source && !(IS_PLAYER(source) || source.caplayer) && !game_stopped - && (IS_PLAYER(privatesay) || privatesay.caplayer) && CHAT_NOSPECTATORS()) + if (privatesay && source && !(IS_PLAYER(source) || INGAME(source)) && !game_stopped + && (IS_PLAYER(privatesay) || INGAME(privatesay)) && CHAT_NOSPECTATORS()) { ret = -1; // just hide the message completely } @@ -304,7 +304,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc dedicated_print(msgstr); // send to server console too if(sourcecmsgstr != "") centerprint(source, sourcecmsgstr); - FOREACH_CLIENT((IS_PLAYER(it) || it.caplayer) && IS_REAL_CLIENT(it) && it != source && it.team == source.team && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { + FOREACH_CLIENT((IS_PLAYER(it) || INGAME(it)) && IS_REAL_CLIENT(it) && it != source && it.team == source.team && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { sprint(it, msgstr); if(cmsgstr != "") centerprint(it, cmsgstr); @@ -315,7 +315,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc { sprint(source, sourcemsgstr); dedicated_print(msgstr); // send to server console too - FOREACH_CLIENT(!(IS_PLAYER(it) || it.caplayer) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { + FOREACH_CLIENT(!(IS_PLAYER(it) || INGAME(it)) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), { sprint(it, msgstr); }); event_log_msg = sprintf(":chat_spec:%d:%s", source.playerid, strreplace("\n", " ", msgin));