nonlocal stuff again
[carveJwlIkooP6JGAAIwe30JlM.git] / world_render.h
index ad0d5c43a2d469fdb31c1650a7559241e08a7457..4e390368e9f4f51a65283e0534b5e54ef349129a 100644 (file)
@@ -359,16 +359,19 @@ VG_STATIC void render_world_gates( world_instance *world, camera *cam,
    }
    
    if( gate ){
-#if 0
-      world_instance *dest_world = &world_global.worlds[ gate->world_index ];
-      render_gate( dest_world, gate, cam, layer_depth );
-#else
-      render_gate( world, gate, cam, layer_depth );
-#endif
-
       /* should really be set in fixed update since its used in the physics
        * of most systems. too bad! */
       world->rendering_gate = gate;
+
+      if( gate->type == k_gate_type_teleport ){
+         render_gate( world, gate, cam, layer_depth );
+      }
+      else if( gate->type == k_gate_type_nonlocel ){
+         world_instance *dest_world = &world_global.worlds[ gate->target ];
+         render_gate( dest_world, gate, cam, layer_depth );
+      }
+      else
+         world->rendering_gate = NULL;
    }
 }
 
@@ -377,7 +380,6 @@ VG_STATIC void world_prerender( world_instance *world )
    static double g_time = 0.0;
    g_time += vg.time_delta * (1.0/(k_day_length*60.0));
 
-
    struct ub_world_lighting *state = &world->ub_lighting;
 
    state->g_time = g_time;