From: terencehill Date: Sat, 6 Jun 2020 08:20:44 +0000 (+0200) Subject: Disambiguate an if-if-else and fix indentation in globalsounds.qc X-Git-Tag: xonotic-v0.8.5~938 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0b855be333c33b5b50baa19aaba0b6efcefa4d8a;p=xonotic%2Fxonotic-data.pk3dir.git Disambiguate an if-if-else and fix indentation in globalsounds.qc --- diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index 4e8467e8a..8ce2b6ed3 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -288,9 +288,9 @@ LoadPlayerSounds(this, "sound/player/default.sounds", true); if (this.model == "null" #ifdef SVQC - && autocvar_g_debug_globalsounds + && autocvar_g_debug_globalsounds #endif - ) return; + ) return; if (autocvar_g_debug_defaultsounds) return; if (LoadPlayerSounds(this, get_model_datafilename(this.model, this.skin, "sounds"), false)) return; LoadPlayerSounds(this, get_model_datafilename(this.model, 0, "sounds"), true); @@ -351,25 +351,30 @@ X(); }); } - #undef X + #undef X break; } case VOICETYPE_AUTOTAUNT: case VOICETYPE_TAUNT: { - if (voicetype == VOICETYPE_AUTOTAUNT) if (!sv_autotaunt) { break; }else {} - else if (IS_PLAYER(this) && !IS_DEAD(this)) animdecide_setaction(this, ANIMACTION_TAUNT, - true); + if (voicetype == VOICETYPE_AUTOTAUNT) + { + if (!sv_autotaunt) break; + } + else if (IS_PLAYER(this) && !IS_DEAD(this)) + animdecide_setaction(this, ANIMACTION_TAUNT, true); + if (!sv_taunt) break; if (autocvar_sv_gentle) break; float tauntrand = 0; if (voicetype == VOICETYPE_AUTOTAUNT) tauntrand = random(); + #define X() \ MACRO_BEGIN \ if (voicetype != VOICETYPE_AUTOTAUNT || tauntrand < CS(msg_entity).cvar_cl_autotaunt) \ { \ float atten = (CS(msg_entity).cvar_cl_voice_directional >= 1) \ - ? bound(ATTEN_MIN, CS(msg_entity).cvar_cl_voice_directional_taunt_attenuation, \ + ? 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, atten); \ @@ -389,7 +394,7 @@ X(); }); } - #undef X + #undef X break; } case VOICETYPE_PLAYERSOUND: