+ }
+
+ v3_copy( pnode->co, relay->pos );
+ world->relay_count ++;
+}
+
+
+VG_STATIC void world_pct_achievement( world_instance *world, mdl_node *pnode )
+{
+ struct logic_achievement *ach =
+ &world->logic_achievements[ world->achievement_count ];
+ struct classtype_logic_achievement *inf =
+ mdl_get_entdata( world->meta, pnode );
+
+ v3_copy( pnode->co, ach->pos );
+ ach->achievement_id = mdl_pstr( world->meta, inf->pstr_name );
+ ach->achieved = 0;
+
+ world->achievement_count ++;
+}
+
+VG_STATIC void world_pct_point_light( world_instance *world, mdl_node *pnode )
+{
+ struct world_light *light = &world->lights[ world->light_count ];
+ v3_copy( pnode->co, light->co );
+
+ struct classtype_point_light *inf = mdl_get_entdata( world->meta, pnode );
+ v4_copy( inf->colour, light->colour );
+
+ world->light_count ++;
+}
+
+VG_STATIC void world_pct_nonlocal_gate( world_instance *world, mdl_node *pnode )
+{
+ struct nonlocal_gate *gate = &world->nonlocal_gates[
+ world->nonlocalgate_count ++ ];
+ struct classtype_gate *inf = mdl_get_entdata( world->meta, pnode );
+
+ gate->working = 0;
+ gate->node = pnode;
+ gate->target_map_index = 0;
+ v2_copy( inf->dims, gate->gate.dims );
+}
+
+VG_STATIC void world_entities_process( world_instance *world )
+{
+ struct entity_instruction
+ {
+ enum classtype ct;
+ void (*process)( world_instance *world, mdl_node *pnode );
+ }
+ entity_instructions[] =
+ {
+ { k_classtype_spawn, world_pct_spawn },
+ { k_classtype_water, world_pct_water },
+ { k_classtype_audio, world_pct_audio },
+ { k_classtype_trigger, world_pct_trigger },
+ { k_classtype_logic_relay, world_pct_relay },
+ { k_classtype_logic_achievement, world_pct_achievement },
+ { k_classtype_point_light, world_pct_point_light },
+ { k_classtype_nonlocal_gate, world_pct_nonlocal_gate }
+ };
+
+ for( int i=0; i<world->meta->info.node_count; i++ )
+ {
+ mdl_node *pnode = mdl_node_from_id( world->meta, i );
+
+ for( int j=0; j<vg_list_size(entity_instructions); j++ )