save location & map, lighting qol
[carveJwlIkooP6JGAAIwe30JlM.git] / world_render.c
index 1c030a6b66f79a90165856589caaa6832fb49c54..c4b24c4959df1f3808613f6a90f15773a3350155 100644 (file)
@@ -439,11 +439,13 @@ VG_STATIC void render_world_gates( world_instance *world, camera *cam,
          render_gate( world, gate, cam, layer_depth );
       }
       else if( gate->type == k_gate_type_nonlocel ){
-         if( skaterift.async_op != k_async_op_world_loading &&
-             skaterift.async_op != k_async_op_world_preloading ){
-            world_instance *dest_world = &world_static.worlds[ gate->target ];
-            render_gate( dest_world, gate, cam, layer_depth );
+         if( world_loader.state != k_world_loader_none ){
+            world->rendering_gate = NULL;
+            return;
          }
+
+         world_instance *dest_world = &world_static.worlds[ gate->target ];
+         render_gate( dest_world, gate, cam, layer_depth );
       }
       else
          world->rendering_gate = NULL;
@@ -452,8 +454,14 @@ VG_STATIC void render_world_gates( world_instance *world, camera *cam,
 
 VG_STATIC void world_prerender( world_instance *world )
 {
-   f32 day_length = vg_maxf(0.1f, fabsf(k_day_length)) * vg_signf(k_day_length);
-   world->time += vg.time_delta * (1.0/(day_length*60.0));
+
+   if( mdl_arrcount( &world->ent_light ) ){
+      f32 rate = vg_maxf(0.1f, fabsf(k_day_length)) * vg_signf(k_day_length);
+      world->time += vg.time_delta * (1.0/(rate*60.0));
+   }
+   else{
+      world->time = 0.834;
+   }
 
    struct ub_world_lighting *state = &world->ub_lighting;