1
0
Fork 0
mirror of https://gitlab.com/Mr_Goldberg/goldberg_emulator.git synced 2024-11-14 10:50:13 +01:00

GetAppInstallDir accuracy improvements.

This commit is contained in:
Mr_Goldberg 2019-12-12 14:11:05 -05:00
parent 4bb4f9459d
commit b8aa74af0e
No known key found for this signature in database
GPG key ID: 8597D87419DEF278

View file

@ -213,9 +213,8 @@ uint32 Steam_Apps::GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uin
// returns current app install folder for AppID, returns folder name length
uint32 Steam_Apps::GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize )
{
PRINT_DEBUG("GetAppInstallDir %u %u\n", appID, cchFolderBufferSize);
PRINT_DEBUG("GetAppInstallDir %u %p %u\n", appID, pchFolder, cchFolderBufferSize);
//TODO return real path instead of dll path
if (!pchFolder || !cchFolderBufferSize) return 0;
std::string installed_path = settings->getAppInstallPath(appID);
if (installed_path.size() == 0) {
@ -232,8 +231,11 @@ uint32 Steam_Apps::GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchF
}
PRINT_DEBUG("path %s\n", installed_path.c_str());
snprintf(pchFolder, cchFolderBufferSize, "%s", installed_path.c_str());
return strlen(pchFolder);
if (cchFolderBufferSize && pchFolder) {
snprintf(pchFolder, cchFolderBufferSize, "%s", installed_path.c_str());
}
return installed_path.length(); //Real steam always returns the actual path length, not the copied one.
}
// returns true if that app is installed (not necessarily owned)