- v3_copy( pnode->co, rp->co );
- v4_copy( pnode->q, rp->q );
- strcpy( rp->name, mdl_pstr( mworld, pnode->pstr_name ) );
- }
- else if( pnode->classtype == k_classtype_water )
- {
- if( wrender.enabled )
- {
- vg_warn( "Multiple water surfaces in level! ('%s')\n",
- mdl_pstr( mworld, pnode->pstr_name ));
- continue;
- }
-
- mdl_submesh *sm = mdl_node_submesh( mworld, pnode, 0 );
-
- if( sm )
- {
- glmesh surf;
- mdl_unpack_submesh( mworld, &surf, sm );
- water_init();
- water_set_surface( &surf, pnode->co[1] );
- }
- }
- else if( pnode->classtype == k_classtype_car_path )
- {
- struct classtype_car_path *p = mdl_get_entdata( mworld, pnode );
- traffic_node *tn = &world.traffic[ world.traffic_count ];
- tn->mn_next = NULL;
- tn->mn_next1 = NULL;
-
- if( p->target ) tn->mn_next = mdl_node_from_id( mworld, p->target );
- if( p->target1 ) tn->mn_next1 = mdl_node_from_id( mworld, p->target1 );
-
- m4x3f transform;
- mdl_node_transform( pnode, transform );
- m3x3_mulv( transform, (v3f){1.0f,0.0f,0.0f}, tn->h );
- v3_copy( transform[3], tn->co );
-
- pnode->sub_uid = world.traffic_count ++;
- }
- else if( pnode->classtype == k_classtype_instance )
- {
- struct classtype_instance *inst = mdl_get_entdata( mworld, pnode );
- pnode->sub_uid = 0;
-
- int cached = 0;
- for( int i=0; i<world.instance_cache_count; i++ )
- {
- struct instance_cache *cache = &world.instance_cache[i];
- if( inst->pstr_file == cache->pstr_file )
- {
- cached = 1;
- pnode->sub_uid = i+1;
- break;
- }
- }
-
- if( !cached )
- {
- world.instance_cache = buffer_reserve(
- world.instance_cache, world.instance_cache_count,
- &world.instance_cache_cap, 1,
- sizeof(struct instance_cache) );