diff --git a/FreePackages/Data/FilterablePackage.cs b/FreePackages/Data/FilterablePackage.cs index 85b16a1..53b1572 100644 --- a/FreePackages/Data/FilterablePackage.cs +++ b/FreePackages/Data/FilterablePackage.cs @@ -18,6 +18,7 @@ internal sealed class FilterablePackage { internal ulong ExpiryTime; internal ulong StartTime; internal uint DontGrantIfAppIDOwned; + internal uint MustOwnAppToPurchase; internal List? RestrictedCountries; internal bool OnlyAllowRestrictedCountries; internal List? PurchaseRestrictedCountries; @@ -38,6 +39,7 @@ internal FilterablePackage(uint id, KeyValue kv, bool isNew) { ExpiryTime = kv["extended"]["expirytime"].AsUnsignedLong(); StartTime = kv["extended"]["starttime"].AsUnsignedLong(); DontGrantIfAppIDOwned = kv["extended"]["dontgrantifappidowned"].AsUnsignedInteger(); + MustOwnAppToPurchase = kv["extended"]["mustownapptopurchase"].AsUnsignedInteger(); RestrictedCountries = kv["extended"]["restrictedcountries"].AsString()?.ToUpper().Split(" ").ToList(); OnlyAllowRestrictedCountries = kv["extended"]["onlyallowrestrictedcountries"].AsBoolean(); PurchaseRestrictedCountries = kv["extended"]["purchaserestrictedcountries"].AsString()?.ToUpper().Split(" ").ToList(); diff --git a/FreePackages/Handlers/PackageFilter.cs b/FreePackages/Handlers/PackageFilter.cs index 2dbf9db..3fdfd0b 100644 --- a/FreePackages/Handlers/PackageFilter.cs +++ b/FreePackages/Handlers/PackageFilter.cs @@ -237,6 +237,11 @@ internal bool IsRedeemablePackage(FilterablePackage package) { } if (package.DontGrantIfAppIDOwned > 0 && OwnedAppIDs.Contains(package.DontGrantIfAppIDOwned)) { + // Owns an app that blocks activation + return false; + } + + if (package.MustOwnAppToPurchase > 0 && !OwnedAppIDs.Contains(package.MustOwnAppToPurchase)) { // Don't own required app return false; }