- vg_msg_cmd kv = vg_msg_seekkv( msg, key, 0 );
- if( kv.code == k_vg_msg_kvstring ){
- vg_strncpy( kv.value, alias->foldername, sizeof(alias->foldername),
- k_strncpy_allow_cutoff );
+ vg_msg_cmd kv;
+ if( vg_msg_getkvcmd( msg, key, &kv ) ){
+ if( kv.code == k_vg_msg_kvstring ){
+ vg_strncpy( kv.value, alias->foldername, sizeof(alias->foldername),
+ k_strncpy_allow_cutoff );
+ }
+ else
+ vg_msg_cast( kv.value, kv.code, &alias->workshop_id, k_vg_msg_u64 );
+ }
+}
+
+static void skaterift_populate_world_savedata( savedata_file *file,
+ enum world_purpose which ){
+ file->path[0] = '\0';
+ file->len = 0;
+ addon_reg *reg = world_static.instance_addons[ which ];
+
+ if( !reg ){
+ vg_error( "Tried to save unspecified world (reg was null)\n" );
+ return;
+ }
+
+ skaterift_world_get_save_path( which, file->path );
+
+ vg_msg sav;
+ vg_msg_init( &sav, file->buf, sizeof(file->buf) );
+
+ if( which == k_world_purpose_hub ){
+ if( world_static.instances[0].status == k_world_status_loaded )
+ world_entity_serialize( &world_static.instances[0], &sav );