]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/qc/globalsound.qh
Merge branch 'master' into Mario/fullbright_skins
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / qc / globalsound.qh
index 7cb8fdb3e7484fd59f9a02c18738d0f001dd3e12..44925cd510cf81c71fe4018b792de9a2f46bda22 100644 (file)
@@ -1,6 +1,11 @@
 #ifndef GLOBALSOUND_H
 #define GLOBALSOUND_H
 
+#ifdef SVQC
+       /** Use new sound handling. TODO: use when sounds play correctly on clients */
+       bool autocvar_g_debug_globalsounds = false;
+#endif
+
 // player sounds, voice messages
 
 .string m_playersoundstr;
@@ -19,7 +24,7 @@ REGISTER_REGISTRY(PlayerSounds)
 REGISTRY_SORT(PlayerSounds)
 STATIC_INIT(PlayerSounds_renumber)
 {
-       FOREACH(PlayerSounds, true, LAMBDA(it.m_id = i));
+       FOREACH(PlayerSounds, true, it.m_id = i);
 }
 REGISTRY_CHECK(PlayerSounds)
 
@@ -90,13 +95,13 @@ REGISTER_REGISTRY(GlobalSounds)
 REGISTRY_SORT(GlobalSounds)
 STATIC_INIT(GlobalSounds_renumber)
 {
-       FOREACH(GlobalSounds, true, LAMBDA(it.m_id = i));
+       FOREACH(GlobalSounds, true, it.m_id = i);
 }
 REGISTRY_CHECK(GlobalSounds)
 void PrecacheGlobalSound(string samplestring);
 PRECACHE(GlobalSounds)
 {
-       FOREACH(GlobalSounds, true, LAMBDA(PrecacheGlobalSound(it.m_globalsoundstr)));
+       FOREACH(GlobalSounds, true, PrecacheGlobalSound(it.m_globalsoundstr));
 }
 
 REGISTER_GLOBALSOUND(STEP, "misc/footstep0 6")
@@ -113,6 +118,7 @@ void PrecachePlayerSounds(string f);
        float LoadPlayerSounds(entity this, string f, bool strict);
        void UpdatePlayerSounds(entity this);
 //#endif
+entity GetVoiceMessage(string type);
 
 #ifdef SVQC
 
@@ -126,7 +132,7 @@ void PrecachePlayerSounds(string f);
                        entity VM = def; \
                        int voicetype = VM.m_playersoundvt; \
                        bool ownteam = (voicetype == VOICETYPE_TEAMRADIO); \
-                       int flood = Say(this, ownteam, world, msg, true); \
+                       int flood = Say(this, ownteam, NULL, msg, true); \
                        bool fake; \
                        if (IS_SPEC(this) || IS_OBSERVER(this) || flood < 0) fake = true; \
                        else if (flood > 0) fake = false; \
@@ -136,4 +142,11 @@ void PrecachePlayerSounds(string f);
 
 #endif
 
+string allvoicesamples;
+STATIC_INIT(allvoicesamples)
+{
+    FOREACH(PlayerSounds, it.instanceOfVoiceMessage, allvoicesamples = strcat(allvoicesamples, " ", it.m_playersoundstr));
+    allvoicesamples = strzone(substring(allvoicesamples, 1, -1));
+}
+
 #endif