diff --git a/dll/steam_apps.cpp b/dll/steam_apps.cpp index 794e35e3..4d563d2c 100644 --- a/dll/steam_apps.cpp +++ b/dll/steam_apps.cpp @@ -181,7 +181,32 @@ bool Steam_Apps::MarkContentCorrupt( bool bMissingFilesOnly ) // return installed depots in mount order uint32 Steam_Apps::GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots ) { - PRINT_DEBUG("GetInstalledDepots\n"); + PRINT_DEBUG("GetInstalledDepots %u\n", appID); + //TODO not sure about the behavior of this function, I didn't actually test this. + if (!pvecDepots) return 0; + std::lock_guard lock(global_mutex); + + if (appID == settings->get_local_game_id().AppID()) { + unsigned int count = settings->DLCCount(); + if (cMaxDepots < count) count = cMaxDepots; + + for (int i = 0; i < count; ++i) { + AppId_t appid; + bool available; + std::string name; + if (settings->getDLC(i, appid, available, name)) { + pvecDepots[i] = appid; + } + } + + return count; + } else { + if (cMaxDepots) { + *pvecDepots = appID; + return 1; + } + } + return 0; }