]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Chat: default to NOTICE_SILENT, fixes a svc_print from the engine making sound when...
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 5 Apr 2018 11:16:23 +0000 (21:16 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 5 Apr 2018 11:16:23 +0000 (21:16 +1000)
qcsrc/client/main.qc

index 4fa24bd3dcb8071f2a10d7bcac6655185c94bf23..20c50f57730be432742ecb2fe1f639d40ae41592 100644 (file)
@@ -916,16 +916,17 @@ void CSQC_Parse_Print(string strMessage)
 {
        if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_Print(\"%s\")", strMessage);
        if (autocvar__cl_hook_print != "") {
-               int flags = 0;
+               int flags = NOTICE_SILENT;
                string s = substring(strMessage, 0, -2); // remove trailing \n
                int c = str2chr(s, 0);
                if (c == 1 || c == 2 || c == 3) {
                        s = substring(s, 1, -1);
-                       if (c != 1) {
-                               flags |= NOTICE_SILENT;
-                       } else if (str2chr(s, 0) == '\r') {
-                               s = substring(s, 1, -1);
-                               flags |= NOTICE_PRIVATE;
+                       if (c == 1) {
+                               flags &= ~NOTICE_SILENT;
+                               if (str2chr(s, 0) == '\r') {
+                                       s = substring(s, 1, -1);
+                                       flags |= NOTICE_PRIVATE;
+                               }
                        }
                        if (c != 2) {
                                flags |= NOTICE_CHAT;