]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/sounds/sound.qh
Merge branch 'master' into TimePath/scoreboard_elo
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / sounds / sound.qh
index 5d6c57f21e55ff9b1caade97b37cf93376df9fae..519f910b0d3fee4721a698c549a59316841d658b 100644 (file)
@@ -35,6 +35,7 @@ const float ATTEN_MAX = 3.984375;
 
 const float VOL_BASE = 0.7;
 const float VOL_BASEVOICE = 1.0;
+const float VOL_MUFFLED = 0.35;
 
 // Play all sounds via sound7, for access to the extra channels.
 // Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
@@ -76,7 +77,7 @@ const float VOL_BASEVOICE = 1.0;
                        auto = true; \
                        __chan = fabs(__chan); \
                        entity tmp = __e = new(csqc_autochannel); \
-                       tmp.think = SUB_Remove_self; \
+                       setthink(tmp, SUB_Remove); \
                        tmp.nextthink = time + soundlength(__samp); \
                } \
                vector old_origin = __e.origin; \
@@ -120,11 +121,12 @@ CLASS(Sound, Object)
                return string_null;
 #endif
        }
-       METHOD(Sound, sound_precache, void(entity this))
+       METHOD(Sound, sound_precache, void(Sound this))
        {
+           TC(Sound, this);
                string s = Sound_fixpath(this);
                if (!s) return;
-               LOG_TRACEF("precache_sound(\"%s\")\n", s);
+               profile(sprintf("precache_sound(\"%s\")\n", s));
                precache_sound(s);
        }
 ENDCLASS(Sound)