From 4bab71a209af36a9baf96ca653cedae5276539be Mon Sep 17 00:00:00 2001 From: Citrinate Date: Sun, 24 Dec 2023 20:36:18 -0500 Subject: [PATCH] Don't ignore DLC packages which include base game --- FreePackages/Handlers/PackageFilter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FreePackages/Handlers/PackageFilter.cs b/FreePackages/Handlers/PackageFilter.cs index df43979..b5d84a9 100644 --- a/FreePackages/Handlers/PackageFilter.cs +++ b/FreePackages/Handlers/PackageFilter.cs @@ -41,7 +41,7 @@ internal void UpdateUserData(UserData userData) { UserData = userData; } - internal bool IsRedeemableApp(FilterableApp app) { + internal bool IsRedeemableApp(FilterableApp app, HashSet? includedAppIDs = null) { if (OwnedAppIDs == null) { throw new InvalidOperationException(nameof(OwnedAppIDs)); } @@ -61,7 +61,7 @@ internal bool IsRedeemableApp(FilterableApp app) { return false; } - if (app.MustOwnAppToPurchase > 0 && !OwnedAppIDs.Contains(app.MustOwnAppToPurchase)) { + if (app.MustOwnAppToPurchase > 0 && !OwnedAppIDs.Contains(app.MustOwnAppToPurchase) && (includedAppIDs == null || !includedAppIDs.Contains(app.MustOwnAppToPurchase))) { // Missing a necessary app return false; } @@ -212,7 +212,7 @@ internal bool IsRedeemablePackage(FilterablePackage package) { } } - if (package.PackageContents.Any(app => !OwnedAppIDs.Contains(app.ID) && !IsRedeemableApp(app))) { + if (package.PackageContents.Any(app => !OwnedAppIDs.Contains(app.ID) && !IsRedeemableApp(app, package.PackageContentIDs))) { // At least one of the unowned apps in this package isn't redeemable return false; }