update audio randomizer
[fishladder.git] / vg / vg_audio.h
index 330be30a17319588d572247737d2ff3aa3231905..6d797717f5c7bf77987e8b011645707a9a93b40a 100644 (file)
@@ -668,15 +668,15 @@ void sfx_set_init( sfx_set_t *dest, char *sources )
 }
 
 // Pick a random sound from the buffer and play it into system
-void sfx_set_playrnd( sfx_set_t *source, sfx_system_t *sys )
+void sfx_set_playrnd( sfx_set_t *source, sfx_system_t *sys, int min_id, int max_id )
 {
        if( !source->numsegments )
        {
                return;
        }
 
-       int pick = rand() % source->numsegments;
-       
+       int pick = (rand() % (max_id-min_id)) + min_id;
+
        sys->source = source->main;
        sys->cur        = source->segments[ pick*2 + 0 ];
        sys->end        = source->segments[ pick*2 + 1 ];