modular stuffs
[carveJwlIkooP6JGAAIwe30JlM.git] / world_routes.h
index 00dee4ea0c79d742a78ad3c023cce8d3f1ed7f65..820501a81c74b82ae514a8afbd33c47446995f85 100644 (file)
@@ -103,7 +103,7 @@ VG_STATIC void world_routes_time_lap( world_instance *world, ent_route *route )
       }
 
       last_version = rg->timing_version;
-      vg_info( "%u %f\n", rg, rg->timing_version, rg->timing_time );
+      vg_info( "%u %f\n", rg->timing_version, rg->timing_time );
    }
 
    if( world_global.current_run_version == last_version+1 ){
@@ -134,10 +134,19 @@ VG_STATIC void world_routes_time_lap( world_instance *world, ent_route *route )
 VG_STATIC void world_routes_activate_entry_gate( world_instance *world, 
                                                  ent_gate *rg )
 {
-   ent_gate *dest = mdl_arritm( &world->ent_gate, rg->target );
-
    world_global.last_use = world_global.time;
 
+   /* disable all routes and leave the world */
+   if( rg->type == k_gate_type_nonlocel ){
+      for( u32 i=0; i<mdl_arrcount(&world->ent_route); i++ ){
+         ent_route *route = mdl_arritm( &world->ent_route, i );
+         route->active_checkpoint = 0xffff;
+      }
+      return;
+   }
+
+   ent_gate *dest = mdl_arritm( &world->ent_gate, rg->target );
+
    for( u32 i=0; i<mdl_arrcount(&world->ent_route); i++ ){
       ent_route *route = mdl_arritm( &world->ent_route, i );
 
@@ -285,8 +294,8 @@ VG_STATIC void world_routes_place_curve( world_instance *world,
          struct world_surface *surfa = ray_hit_surface( world, &ha ),
                               *surfb = ray_hit_surface( world, &hb );
 
-         if( (surfa->info.flags & k_material_flag_skate_surface) &&
-             (surfb->info.flags & k_material_flag_skate_surface) )
+         if( (surfa->info.flags & k_material_flag_skate_target) &&
+             (surfb->info.flags & k_material_flag_skate_target) )
          {
             scene_vert va, vb;