oh yeah mr crabs
[carveJwlIkooP6JGAAIwe30JlM.git] / player_audio.h
index 33a050a7d523457711f290c818bfcb4f71e2b3db..00bc9c440fb39540c54afc8611188b3e4efd1d74 100644 (file)
@@ -25,15 +25,23 @@ static void player_audio(void)
 
 
    audio_lock();
-   
+
    double revert_delta = vg.time - last_revert;
-   if( phys->on_board && (!_air && l2) && (fabsf(phys->slip) > 0.5f) && 
-         (revert_delta > 0.7) )
+   if( phys->on_board && (!_air && l2) && (revert_delta > 0.7) &&
+       (player.air_time > 0.5f) )
    {
       audio_player_set_position( &audio_player_extra, phys->rb.co );
       audio_player_set_flags( &audio_player_extra, AUDIO_FLAG_SPACIAL_3D );
       audio_player_set_vol( &audio_player_extra, 2.0f );
-      audio_player_playclip( &audio_player_extra, &audio_lands[rand()%5] );
+
+      if( (fabsf(phys->slip) > 0.75f) )
+      {
+         audio_player_playclip( &audio_player_extra, &audio_lands[rand()%2+3] );
+      }
+      else
+      {
+         audio_player_playclip( &audio_player_extra, &audio_lands[rand()%3] );
+      }
 
       last_revert = vg.time;
    }
@@ -147,6 +155,12 @@ static void player_audio(void)
    world_audio_update( cam, ears );
 #endif
    audio_unlock();
+
+   if( player.phys.in_air )
+      player.air_time += vg.time_delta;
+   else
+      player.air_time = 0.0f;
+   
 }
 
 #endif /* PLAYER_AUDIO_H */