seperate rand instances for each thread
[carveJwlIkooP6JGAAIwe30JlM.git] / audio.h
diff --git a/audio.h b/audio.h
index 0d025c8195e75ef7159dcf5fb7f7371b97c87092..917b8ec8732ab6c6a8be7b374ec7f2112df8eac3 100644 (file)
--- a/audio.h
+++ b/audio.h
@@ -224,12 +224,13 @@ static void audio_ambient_sprites_update( world_instance *world, v3f co )
    
    if( sprite_type != k_audio_sprite_type_none ){
       if( sprite_type == k_audio_sprite_type_grass ){
-         audio_ambient_sprite_play( sprite_pos, &audio_grass[vg_randu32()%4] );
+         audio_ambient_sprite_play( sprite_pos, 
+                                    &audio_grass[vg_randu32(&vg.rand)%4] );
       }
       else if( sprite_type == k_audio_sprite_type_water ){
          if( world->water.enabled ){
             audio_ambient_sprite_play( sprite_pos, 
-                                       &audio_water[vg_randu32()%6] );
+                                       &audio_water[vg_randu32(&vg.rand)%6] );
          }
       }
    }