X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=world_load.c;fp=world_load.c;h=f907a2bda23d58ca0b7885826a21a1c4ee18e5c8;hb=6f65127266e9c27e11af3f72de903f23ff3c706e;hp=fd75aa8f8cca887ca34443154fbaf071800936ff;hpb=137d40d96fe923600d8378b8e138e3c276f27ff4;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_load.c b/world_load.c index fd75aa8..f907a2b 100644 --- a/world_load.c +++ b/world_load.c @@ -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 );