scuffed input compression pt1
[carveJwlIkooP6JGAAIwe30JlM.git] / world_load.c
index fd75aa8f8cca887ca34443154fbaf071800936ff..f1308c151134830e6651509ce8bf731a847423d7 100644 (file)
@@ -80,11 +80,9 @@ static void world_instance_load_mdl( u32 instance_id, const char *path ){
       world->info.timezone = 0.0f;
    }
 
-   time_t t;
-   struct tm *tm;
-   time( &t );
-   tm = gmtime( &t );
-   world->time = (float)tm->tm_min/20.0f + (world->info.timezone/24.0f);
+   time_t seconds = time(NULL) % ((u32)k_day_length*60);
+   world->time  = ((f64)(seconds)/(k_day_length*60.0));
+   world->time += (world->info.timezone/24.0);
 
    /* process resources from pack */
    world_gen_load_surfaces( world );
@@ -103,7 +101,7 @@ static void world_instance_load_mdl( u32 instance_id, const char *path ){
 
    for( u32 i=0; i<mdl_arrcount( &world->ent_route ); i ++ ){
       struct leaderboard_cache *board = &world->leaderboard_cache[i];
-      board->data = vg_linear_alloc( heap, NETWORK_LEADERBOARD_MAX_SIZE );
+      board->data = vg_linear_alloc( heap, NETWORK_REQUEST_MAX );
       board->status = k_request_status_client_error;
       board->cache_time = 0.0;
       board->data_len = 0;