]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/qc/globalsound.qc
Merge branch 'master' into Mario/headshots
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / qc / globalsound.qc
index 4653f4a956084108ac62bc36e9eb4b006389da1e..8ce2b6ed3a4a8b7ea0fd09ddf75bf9b241b03847 100644 (file)
@@ -85,7 +85,7 @@
 
                NET_HANDLE(globalsound, bool isnew)
                {
-                       entity gs = GlobalSounds_from(ReadByte());
+                       entity gs = REGISTRY_GET(GlobalSounds, ReadByte());
                        float r = ReadByte() / 255;
                        string sample = GlobalSound_sample(gs.m_globalsoundstr, r);
                        int who = ReadByte();
 
                NET_HANDLE(playersound, bool isnew)
                {
-                       entity ps = PlayerSounds_from(ReadByte());
+                       entity ps = REGISTRY_GET(PlayerSounds, ReadByte());
                        float r = ReadByte() / 255;
                        int who = ReadByte();
                        entity e = entcs_receiver(who - 1);
                                if (GetPlayerSoundSampleField_notFound) field = GetVoiceMessageSampleField(key);
                                if (GetPlayerSoundSampleField_notFound)
                                {
-                                       LOG_TRACEF("Invalid sound info field: %s", key);
+                                       LOG_TRACEF("Invalid sound info field in player sound file '%s': %s", f, key);
                                        continue;
                                }
                                string file = argv(1);
                        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);
                                                        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); \
                                                        X();
                                                });
                                        }
-               #undef X
+                                       #undef X
                                        break;
                                }
                                case VOICETYPE_PLAYERSOUND: