diff --git a/dll/settings.cpp b/dll/settings.cpp index 95793aa2..304810bc 100644 --- a/dll/settings.cpp +++ b/dll/settings.cpp @@ -251,6 +251,11 @@ bool Settings::getDLC(unsigned int index, AppId_t &appID, bool &available, std:: return true; } +bool Settings::allDLCUnlocked() const +{ + return this->unlockAllDLCs; +} + void Settings::setAppInstallPath(AppId_t appID, std::string path) { app_paths[appID] = path; diff --git a/dll/settings.h b/dll/settings.h index 96e4e451..0c0f7924 100644 --- a/dll/settings.h +++ b/dll/settings.h @@ -167,6 +167,7 @@ public: unsigned int DLCCount(); bool hasDLC(AppId_t appID); bool getDLC(unsigned int index, AppId_t &appID, bool &available, std::string &name); + bool allDLCUnlocked() const; //Depots std::vector depots; diff --git a/dll/steam_apps.cpp b/dll/steam_apps.cpp index 7441264d..91ba5c57 100644 --- a/dll/steam_apps.cpp +++ b/dll/steam_apps.cpp @@ -245,12 +245,21 @@ uint32 Steam_Apps::GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchF bool Steam_Apps::BIsAppInstalled( AppId_t appID ) { PRINT_DEBUG("BIsAppInstalled %u\n", appID); - // is this true? it seems to indicate a non-steam game + std::lock_guard lock(global_mutex); + + // "0 Base Goldsource Shared Binaries" + // https://developer.valvesoftware.com/wiki/Steam_Application_IDs if (appID == 0) return true; // game LEGO® 2K Drive (app id 1451810) checks for a proper steam behavior by sending uint32_max and expects false in return if (appID == UINT32_MAX) return false; if (appID == settings->get_local_game_id().AppID()) return true; + // only check for DLC if the the list is limited/bounded, + // calling hasDLC() wehn unlockAllDLCs is true will always satisfy the below condition + if (!settings->allDLCUnlocked() && settings->hasDLC(appID)) { + return false; + } + return settings->appIsInstalled(appID); }