reset run when using lgider
[carveJwlIkooP6JGAAIwe30JlM.git] / player_glide.c
index 331565c58f8b58e4eb982ce22afe7ab7df2528d6..96d3eac02f7cccb8b2fe33c519ef57d5fb573605 100644 (file)
@@ -289,10 +289,21 @@ static void player_glide_im_gui(void){
                            player_glide.info_drag[2] );
 }
 
+static void player_glide_equip_glider(void){
+   if( !localplayer.have_glider ){
+      localplayer.have_glider = 1;
+      localplayer.glider_orphan = 0;
+      player_glide.t = -1.0f;
+   }
+}
+
 static int ccmd_player_glider_spawn( int argc, const char *argv[] ){
-   localplayer.have_glider = 1;
-   localplayer.glider_orphan = 0;
-   player_glide.t = -1.0f;
+   if( vg_console.cheats ){
+      player_glide_equip_glider();
+   }
+   else {
+      vg_error( "Can't spawn without cheats enabled.\n" );
+   }
    return 0;
 }
 
@@ -418,6 +429,16 @@ static void player_glide_bind(void){
 static void player_glide_transition(void){
    localplayer.subsystem = k_player_subsystem_glide;
    localplayer.have_glider = 0;
+   world_static.challenge_target = NULL;
+   world_static.challenge_timer = 0.0f;
+   world_static.focused_entity = 0;
+   world_static.last_use = 0.0;
+   for( u32 i=0; i<vg_list_size(world_static.instances); i++ ){
+      world_instance *instance = &world_static.instances[i];
+      if( instance->status == k_world_status_loaded ){
+         world_routes_clear( instance );
+      }
+   }
 
    v3_copy( localplayer.rb.co, player_glide.rb.co );