do the requested changes

This commit is contained in:
counter185 2023-02-26 07:54:30 +01:00
parent 85df6c253f
commit 55fea07fef

View File

@ -1,4 +1,7 @@
#include <std_include.hpp> #include <std_include.hpp>
#include <utils/nt.hpp>
#include "../steam.hpp" #include "../steam.hpp"
namespace steam namespace steam
@ -33,18 +36,20 @@ namespace steam
return "english"; return "english";
} }
// This is used for checking DLC too.
bool apps::BIsSubscribedApp(unsigned int appID) bool apps::BIsSubscribedApp(unsigned int appID)
{ {
return appID == 366842 ? std::filesystem::exists("zone/zm_common.xpak") //zombies static const auto has_campaign = std::filesystem::exists(::utils::nt::library{}.get_path() / "zone/cp_common.xpak");
: appID == 366841 ? std::filesystem::exists("zone/mp_common.xpak") //multiplayer static const auto has_multiplayer = std::filesystem::exists(::utils::nt::library{}.get_path() / "zone/mp_common.xpak");
: appID == 366840 ? std::filesystem::exists("zone/cp_common.xpak") //campaign static const auto has_zombies = std::filesystem::exists(::utils::nt::library{}.get_path() / "zone/zm_common.xpak");
return appID == 366840 ? has_campaign
: appID == 366841 ? has_multiplayer
: appID == 366842 ? has_zombies
: true; : true;
} }
bool apps::BIsDlcInstalled(unsigned int appID) bool apps::BIsDlcInstalled(unsigned int appID)
{ {
return BIsSubscribedApp(appID); //to not repeat the same code here return BIsSubscribedApp(appID);
} }
unsigned int apps::GetEarliestPurchaseUnixTime(unsigned int nAppID) unsigned int apps::GetEarliestPurchaseUnixTime(unsigned int nAppID)