X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Feffects%2Fqc%2Fglobalsound.qc;h=edf995a0f6ccf453f64aa49ff175608aa3c6205f;hb=e57fd111a3279a4aa4789e2c72f9c819a56c7be9;hp=b9069705e3b97657ab9163f5366067503b412c72;hpb=f2421381ee500c827138508f743445724faf097f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index b9069705e..edf995a0f 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -2,11 +2,10 @@ #include -#ifdef IMPLEMENTATION #include #ifdef SVQC - #include + #include #endif REGISTER_NET_TEMP(globalsound) @@ -114,7 +113,7 @@ else { // Can this happen? - LOG_WARNINGF("Missing entcs data for player %d\n", who); + LOG_WARNF("Missing entcs data for player %d", who); sound8(e, o, chan, sample, vol, atten, 0, 0); } return true; @@ -146,7 +145,7 @@ else { // Can this happen? - LOG_WARNINGF("Missing entcs data for player %d\n", who); + LOG_WARNF("Missing entcs data for player %d", who); sound8(e, o, chan, sample, vol, atten, 0, 0); } return true; @@ -219,7 +218,7 @@ int fh = fopen(f, FILE_READ); if (fh < 0) { - LOG_WARNINGF("Player sound file not found: %s\n", f); + LOG_WARNF("Player sound file not found: %s", f); return; } for (string s; (s = fgets(fh)); ) @@ -227,7 +226,7 @@ int n = tokenize_console(s); if (n != 3) { - if (n != 0) LOG_WARNINGF("Invalid sound info line: %s\n", s); + if (n != 0) LOG_WARNF("Invalid sound info line: %s", s); continue; } string file = argv(1); @@ -261,7 +260,7 @@ int fh = fopen(f, FILE_READ); if (fh < 0) { - if (strict) LOG_WARNINGF("Player sound file not found: %s\n", f); + if (strict) LOG_WARNF("Player sound file not found: %s", f); return false; } for (string s; (s = fgets(fh)); ) @@ -269,7 +268,7 @@ int n = tokenize_console(s); if (n != 3) { - if (n != 0) LOG_WARNINGF("Invalid sound info line: %s\n", s); + if (n != 0) LOG_WARNF("Invalid sound info line: %s", s); continue; } string key = argv(0); @@ -277,7 +276,7 @@ if (GetPlayerSoundSampleField_notFound) field = GetVoiceMessageSampleField(key); if (GetPlayerSoundSampleField_notFound) { - LOG_TRACEF("Invalid sound info field: %s\n", key); + LOG_TRACEF("Invalid sound info field: %s", key); continue; } string file = argv(1); @@ -316,7 +315,7 @@ #ifdef SVQC - void _GlobalSound(entity this, entity gs, entity ps, string sample, int chan, int voicetype, bool fake) + void _GlobalSound(entity this, entity gs, entity ps, string sample, int chan, float vol, int voicetype, bool fake) { if (gs == NULL && ps == NULL && sample == "") return; if(this.classname == "body") return; @@ -333,10 +332,10 @@ msg_entity = this.pusher; if (IS_REAL_CLIENT(msg_entity)) { - float atten = (msg_entity.cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; - if (gs) globalsound(MSG_ONE, this, gs, r, chan, VOL_BASEVOICE, atten); - else if (ps) playersound(MSG_ONE, this, ps, r, chan, VOL_BASEVOICE, atten); - else soundto(MSG_ONE, this, chan, sample, VOL_BASEVOICE, atten); + float atten = (CS(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; + if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten); + else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten); + else soundto(MSG_ONE, this, chan, sample, vol, atten); } } if (voicetype == VOICETYPE_LASTATTACKER_ONLY) break; @@ -354,10 +353,10 @@ #define X() \ MACRO_BEGIN \ { \ - float atten = (msg_entity.cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; \ - if (gs) globalsound(MSG_ONE, this, gs, r, chan, VOL_BASEVOICE, atten); \ - else if (ps) playersound(MSG_ONE, this, ps, r, chan, VOL_BASEVOICE, atten); \ - else soundto(MSG_ONE, this, chan, sample, VOL_BASEVOICE, atten); \ + float atten = (CS(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; \ + if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten); \ + else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten); \ + else soundto(MSG_ONE, this, chan, sample, vol, atten); \ } MACRO_END if (fake) { msg_entity = this; X(); } @@ -384,15 +383,15 @@ #define X() \ MACRO_BEGIN \ { \ - if (voicetype != VOICETYPE_AUTOTAUNT || tauntrand < msg_entity.cvar_cl_autotaunt) \ + if (voicetype != VOICETYPE_AUTOTAUNT || tauntrand < CS(msg_entity).cvar_cl_autotaunt) \ { \ - float atten = (msg_entity.cvar_cl_voice_directional >= 1) \ - ? bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, \ + float atten = (CS(msg_entity).cvar_cl_voice_directional >= 1) \ + ? bound(ATTEN_MIN, CS(msg_entity).cvar_cl_voice_directional_taunt_attenuation, \ ATTEN_MAX) \ : ATTEN_NONE; \ - if (gs) globalsound(MSG_ONE, this, gs, r, chan, VOL_BASEVOICE, atten); \ - else if (ps) playersound(MSG_ONE, this, ps, r, chan, VOL_BASEVOICE, atten); \ - else soundto(MSG_ONE, this, chan, sample, VOL_BASEVOICE, atten); \ + if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten); \ + else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten); \ + else soundto(MSG_ONE, this, chan, sample, vol, atten); \ } \ } MACRO_END if (fake) @@ -415,15 +414,15 @@ msg_entity = this; if (fake) { - if (gs) globalsound(MSG_ONE, this, gs, r, chan, VOL_BASE, ATTEN_NORM); - else if (ps) playersound(MSG_ONE, this, ps, r, chan, VOL_BASE, ATTEN_NORM); - else soundto(MSG_ONE, this, chan, sample, VOL_BASE, ATTEN_NORM); + if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, ATTEN_NORM); + else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, ATTEN_NORM); + else soundto(MSG_ONE, this, chan, sample, vol, ATTEN_NORM); } else { - if (gs) globalsound(MSG_ALL, this, gs, r, chan, VOL_BASE, ATTEN_NORM); - else if (ps) playersound(MSG_ALL, this, ps, r, chan, VOL_BASE, ATTEN_NORM); - else _sound(this, chan, sample, VOL_BASE, ATTEN_NORM); + if (gs) globalsound(MSG_ALL, this, gs, r, chan, vol, ATTEN_NORM); + else if (ps) playersound(MSG_ALL, this, ps, r, chan, vol, ATTEN_NORM); + else _sound(this, chan, sample, vol, ATTEN_NORM); } break; } @@ -436,4 +435,3 @@ } #endif -#endif