allow replays to pass through rifts
[carveJwlIkooP6JGAAIwe30JlM.git] / player.c
index bd929a5f94973c1e9923ef09c437ca58e2242081..498b27e81c8a3561a3b3058cbeb907182d0ca6a7 100644 (file)
--- a/player.c
+++ b/player.c
@@ -128,6 +128,7 @@ static void player__post_update(void){
  */
 static void player__pass_gate( u32 id ){
    world_instance *world = world_current_instance();
+   skaterift_record_frame( &skaterift.replay, 1 );
 
    /* update boundary hash (network animation) */
    u16 index = mdl_entity_id_id(id) & ~NETMSG_BOUNDARY_MASK;
@@ -139,6 +140,7 @@ static void player__pass_gate( u32 id ){
    world_routes_fracture( world, gate, localplayer.rb.co, localplayer.rb.v );
 
    localplayer.gate_waiting = gate;
+   localplayer.deferred_frame_record = 1;
 
    struct player_cam_controller *cc = &localplayer.cam_control;
    m4x3_mulv( gate->transport, cc->tpv_lpf, cc->tpv_lpf );
@@ -157,9 +159,12 @@ static void player__pass_gate( u32 id ){
 
       world_static.active_instance = gate->target;
       player__clean_refs();
+
+      replay_clear( &skaterift.replay );
    }
-   else 
+   else {
       world_routes_activate_entry_gate( world, gate );
+   }
    
    v3f v0;
    v3_angles_vector( localplayer.angles, v0 );
@@ -169,8 +174,6 @@ static void player__pass_gate( u32 id ){
    audio_lock();
    audio_oneshot( &audio_gate_pass, 1.0f, 0.0f );
    audio_unlock();
-
-   replay_clear( &skaterift.replay );
 }
 
 static void player_apply_transport_to_cam( m4x3f transport ){