]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
properly loop the track (needs the getsoundtime function!)
authorRudolf Polzer <divverent@alientrap.org>
Thu, 6 May 2010 06:43:26 +0000 (08:43 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 6 May 2010 06:43:26 +0000 (08:43 +0200)
config_update.cfg
defaultXonotic.cfg
qcsrc/client/csqc_builtins.qc
qcsrc/client/target_music.qc

index 0143318be3e98c8aa12e4a1f110730582142e8e6..372784dd780c5cc14b7e4affc50518ddca673458 100644 (file)
@@ -20,3 +20,6 @@ _update_configversion_$g_configversion
 _update_generic
 
 set g_configversion 2
+
+// we now use mastervolume
+volume 1
index d373f9964dbf8488e827e8b5c58668c000ce9c9e..35abf9dbef84a134c9deabf87f269cfa7aa9958a 100644 (file)
@@ -1810,3 +1810,6 @@ seta cl_autodemo_delete_keeprecords 0 "when 1, records with a newly made race/ct
 
 // freeze camera
 set cl_lockview 0 "when 1, the camera does not move any more"
+
+// we now use mastervolume
+volume 1
index d3e42cd986a566348f5a193fe5b62fec97ff5290..c108a4ca0ab152a2239f0551e8364ab98c343a2f 100644 (file)
@@ -308,3 +308,5 @@ float PI      = 3.14159265358979323846264338327950288419716939937510582097494459
 float log(float f) = #532;
 
 void(entity e, entity ignore) tracetoss = #64;
+
+float(entity e, float ch) getsoundtime = #533; // (DP_SND_GETSOUNDTIME)
index 97faf67900d73b77b54cc69b99949c656cbdb133..03cedcd81085e1f25a713c89b3986d913a882ad7 100644 (file)
@@ -17,6 +17,10 @@ void TargetMusic_Advance()
        for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); )
        {
                s0 = e.state;
+               if(getsoundtime(e, CHAN_VOICE) < 0)
+               {
+                       s0 = -1;
+               }
                if(e == best)
                {
                        // increase volume
@@ -35,7 +39,10 @@ void TargetMusic_Advance()
                }
                if(e.state != s0)
                {
-                       sound(e, CHAN_VOICE, "", e.volume * e.state * cvar("bgmvolume"), ATTN_NONE);
+                       if(s0 < 0)
+                               sound(e, CHAN_VOICE, e.noise, e.volume * e.state * cvar("bgmvolume"), ATTN_NONE); // restart
+                       else
+                               sound(e, CHAN_VOICE, "", e.volume * e.state * cvar("bgmvolume"), ATTN_NONE);
                }
        }
        music_trigger = world;