sync time between clients to utc
[carveJwlIkooP6JGAAIwe30JlM.git] / world_render.c
index e6c709afb0d141438a9726256d4889cf06f74a46..aa74bbfb6a2f6c4ab7e045348795cc33dd67eb43 100644 (file)
 #include "respawn.h"
 
 static int ccmd_set_time( int argc, const char *argv[] ){
-   if( argc == 1 ){
-      world_instance *world = world_current_instance();
+   world_instance *world = world_current_instance();
+   if( argc == 1 )
       world->time = atof( argv[0] );
-   }
-   else {
-      vg_error( "Usage set_time <0-1.0>\n" );
-   }
+   else 
+      vg_error( "Usage set_time <0-1.0> (current time: %f)\n", world->time );
    return 0;
 }
 
@@ -735,12 +733,10 @@ static void render_world_gates( world_instance *world, camera *cam,
    }
 }
 
-static void world_prerender( world_instance *world )
-{
-
+static void world_prerender( world_instance *world ){
    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));
+      world->time += vg.time_frame_delta * (1.0/(rate*60.0));
    }
    else{
       world->time = 0.834;