]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/sounds/sounds.qh
Items: rename registry globals
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / sounds / sounds.qh
index 6b6a8a1ad7d84a5851639c03e94f90e94a735a15..c9838b2f6a0dabb8243fe78265a9da6665e263e6 100644 (file)
@@ -1,6 +1,21 @@
 #ifndef SOUNDS_H
 #define SOUNDS_H
 
+#include "../teams.qh"
+
+// Play all sounds via sound7, for access to the extra channels.
+// Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
+#ifdef SVQC
+    #define _sound(e, c, s, v, a) do { \
+        entity __e = e; \
+        if (!sound_allowed(MSG_BROADCAST, __e)) break; \
+        sound7(__e, c, s, v, a, 0, 0); \
+    } while (0)
+#else
+    #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
+#endif
+#define sound(e, c, s, v, a) _sound(e, c, s.sound_str(), v, a)
+// Used in places where a string is required
 #define SND(id) (SND_##id.sound_str())
 
 void RegisterSounds();