process triggers on leave world
[carveJwlIkooP6JGAAIwe30JlM.git] / world_load.c
index e8f545c56dff8af10b154dcb9e925d77402b87d2..6378e9bd5cac18487da984d3c3b97a1d408fb00c 100644 (file)
@@ -68,12 +68,20 @@ static void world_instance_load_mdl( u32 instance_id, const char *path ){
    mdl_load_array( meta, &world->ent_relay,     "ent_relay",      heap );
    mdl_load_array( meta, &world->ent_cubemap,   "ent_cubemap",    heap );
    mdl_load_array( meta, &world->ent_miniworld, "ent_miniworld",  heap );
+   mdl_load_array( meta, &world->ent_prop,      "ent_prop",  heap );
 
    mdl_array_ptr infos;
    mdl_load_array( meta, &infos, "ent_worldinfo", vg_mem.scratch );
 
+   world->skybox = k_skybox_default;
    if( mdl_arrcount(&infos) ){
       world->info = *((ent_worldinfo *)mdl_arritm(&infos,0));
+
+      if( world->meta.info.version >= 104 ){
+         if( MDL_CONST_PSTREQ( &world->meta, world->info.pstr_skybox,"space")){
+            world->skybox = k_skybox_space;
+         }
+      }
    }
    else{
       world->info.pstr_author = 0;
@@ -82,7 +90,7 @@ static void world_instance_load_mdl( u32 instance_id, const char *path ){
       world->info.timezone = 0.0f;
    }
 
-   time_t seconds = time(NULL) % ((u32)k_day_length*60);
+   time_t seconds = time(NULL) % ((u32)vg_maxf(1.0f,k_day_length)*60);
    world->time  = ((f64)(seconds)/(k_day_length*60.0));
    world->time += (world->info.timezone/24.0);