restore achivements from steam
[carveJwlIkooP6JGAAIwe30JlM.git] / world_entity.c
index 834ede636ab83ec8c6e4d235959e2b352c06f880..04bbec9891749740e2cc8d51534e710b16371077 100644 (file)
@@ -648,6 +648,25 @@ static void world_entity_start( world_instance *world, vg_msg *sav ){
 
                cp->best_time = sections[j];
             }
+
+            /* LEGACY: check if steam achievements can give us a medal */
+            if( steam_ready  && steam_stats_ready ){
+               for( u32 j=0; j<vg_list_size(track_infos); j ++ ){
+                  struct track_info *inf = &track_infos[j];
+                  if( !strcmp(inf->name,
+                              mdl_pstr(&world->meta,route->pstr_name))){
+                     
+                     steamapi_bool set = 0;
+                     if( SteamAPI_ISteamUserStats_GetAchievement( 
+                              hSteamUserStats, inf->achievement_id, &set ) )
+                     {
+                        if( set ){
+                           route->flags |= k_ent_route_flag_achieve_silver;
+                        }
+                     }
+                  }
+               }
+            }
          }
       }
    }