From: z411 Date: Sat, 16 Jan 2021 22:07:54 +0000 (-0300) Subject: Updating chat sounds to use new client CVAR wrapper X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=039b448a5500de110cb73c0e3a0bbefe5638c03a;p=xonotic%2Fxonotic-data.pk3dir.git Updating chat sounds to use new client CVAR wrapper --- diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index a42587ab1..0dfb7455e 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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); diff --git a/qcsrc/server/chat.qc b/qcsrc/server/chat.qc index 2900ddb01..3f56ca77e 100644 --- a/qcsrc/server/chat.qc +++ b/qcsrc/server/chat.qc @@ -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);