build system revision
[carveJwlIkooP6JGAAIwe30JlM.git] / addon.c
diff --git a/addon.c b/addon.c
index 7ebd165756645a7979a06efdbb3377006143570f..984bb9c62cf40d868a257c012d41b365eacc69f9 100644 (file)
--- a/addon.c
+++ b/addon.c
@@ -335,7 +335,7 @@ static addon_reg *addon_mount_workshop_folder( PublishedFileId_t workshop_id,
    vg_msg_init( &msg, reg->metadata, reg->metadata_len );
 
    if( vg_msg_seekframe( &msg, "workshop" )){
-      type = vg_msg_getkvu32( &msg, "type", 0 );
+      vg_msg_getkvintg( &msg, "type", k_vg_msg_u32, &type );
    }
 
    if( type == k_addon_type_none ){
@@ -368,7 +368,7 @@ static addon_reg *addon_mount_local_addon( const char *folder,
       if( (reg->alias.type == type) && (reg->foldername_hash == folder_hash) ){
          if( !strcmp( reg->alias.foldername, folder_name ) ){
             reg->state = k_addon_state_indexed;
-            return NULL;
+            return reg;
          }
       }
    }
@@ -429,7 +429,12 @@ static addon_reg *addon_mount_local_addon( const char *folder,
  * Check all subscribed items
  */
 static void addon_mount_workshop_items(void){
+   if( skaterift.demo_mode ){
+      vg_info( "Won't load workshop items in demo mode\n" );
+      return;
+   }
    if( !steam_ready ) return;
+
    /*
     * Steam workshop scan
     */