]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Updating chat sounds to use new client CVAR wrapper
authorz411 <z411@omaera.org>
Sat, 16 Jan 2021 22:07:54 +0000 (19:07 -0300)
committerz411 <z411@omaera.org>
Sat, 16 Jan 2021 22:07:54 +0000 (19:07 -0300)
qcsrc/client/main.qc
qcsrc/server/chat.qc

index a42587ab11aab0887c0ef69029bb5f16f261f6bd..0dfb7455e283c7c8e4ec82d642bde3ec3b153322 100644 (file)
@@ -1083,6 +1083,7 @@ NET_HANDLE(TE_CSQC_CHATSOUND, bool isNew)
 {
        string snd = ReadString();
        snd = strcat("chat/", snd, ".ogg");
+       LOG_INFOF("Client got chat sound %s", snd);
        
        precache_sound(snd);
        _sound(NULL, CH_INFO, snd, VOL_BASE, ATTN_NONE);
index 2900ddb01c5313d3eaccab50a2e67be586e1e9b1..3f56ca77e6b46130fd820cde0e84c66f6db65864 100644 (file)
@@ -354,7 +354,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
 
 bool play_chatsound(entity source, string msgin)
 {
-       if(autocvar_sv_chat_sounds && CS(source).cvar_cl_chat_sounds) {
+       if(autocvar_sv_chat_sounds && CS_CVAR(source).cvar_cl_chat_sounds) {
                var .float flood_sound = floodcontrol_chatsound;
                
                if (source.(flood_sound) < time - autocvar_sv_chat_sounds_flood) {
@@ -364,7 +364,7 @@ bool play_chatsound(entity source, string msgin)
                        
                        FOREACH_WORD(autocvar_sv_chat_sounds_list, it == rawmsg, { found = true; });
                        if (found) {
-                               FOREACH_CLIENT(IS_REAL_CLIENT(it) && CS(it).cvar_cl_chat_sounds, {
+                               FOREACH_CLIENT(IS_REAL_CLIENT(it) && CS_CVAR(it).cvar_cl_chat_sounds, {
                                        msg_entity = it;
                                        WriteHeader(MSG_ONE, TE_CSQC_CHATSOUND);
                                        WriteString(MSG_ONE, rawmsg);