nonlocal stuff again
[carveJwlIkooP6JGAAIwe30JlM.git] / world_routes.h
index 00dee4ea0c79d742a78ad3c023cce8d3f1ed7f65..66a4fa5c022bfd0154fc91a7f0f3086251b7cd18 100644 (file)
@@ -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 );