Untested version of GetInstalledDepots.

This commit is contained in:
Mr_Goldberg 2019-07-20 14:45:37 -04:00
parent d2fba40cb4
commit 55835de708
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
1 changed files with 26 additions and 1 deletions

View File

@ -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<std::recursive_mutex> 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;
}