+ if( player->rewinding ){
+ return;
+ }
+
+ if( button_down( k_srbind_reset ) && !player->immobile ){
+ double delta = world_global.time - world_global.last_use;
+
+ if( (delta <= RESET_MAX_TIME) && (world_global.last_use != 0.0) ){
+ player->rewinding = 1;
+ player->rewind_sound_wait = 1;
+ player->rewind_time = (double)player->rewind_length - 0.0001;
+ player_save_rewind_frame( player );
+
+ audio_lock();
+ audio_oneshot( &audio_rewind[0], 1.0f, 0.0f );
+ audio_unlock();
+
+ /* based on testing. DONT CHANGE!
+ *
+ * time taken: y = (x^(4/5)) * 74.5
+ * inverse : x = (2/149)^(4/5) * y^(4/5)
+ */
+
+ float constant = powf( 2.0f/149.0f, 4.0f/5.0f ),
+ curve = powf( player->rewind_total_length, 4.0f/5.0f );
+
+ player->rewind_predicted_time = constant * curve;
+ player->rewind_start = vg.time;
+ player->subsystem = player->subsystem_gate;
+ player->rb = player->rb_gate_storage;
+ v3_copy( player->angles_storage, player->angles );
+
+ if( _player_restore[ player->subsystem ] )
+ _player_restore[ player->subsystem ]( player );
+ }
+ else{
+ if( player->subsystem == k_player_subsystem_dead ){
+ localplayer_cmd_respawn( 0, NULL );
+ }
+ else{
+ /* cant do that */
+ audio_lock();
+ audio_oneshot( &audio_rewind[4], 1.0f, 0.0f );
+ audio_unlock();
+ }
+ }
+ }
+
+ if( button_down( k_srbind_camera ) && !player->immobile ){