Skip to content

Commit

Permalink
Don't ignore DLC packages which include base game
Browse files Browse the repository at this point in the history
  • Loading branch information
Citrinate committed Dec 25, 2023
1 parent 2c7308c commit 4bab71a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions FreePackages/Handlers/PackageFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal void UpdateUserData(UserData userData) {
UserData = userData;
}

internal bool IsRedeemableApp(FilterableApp app) {
internal bool IsRedeemableApp(FilterableApp app, HashSet<uint>? includedAppIDs = null) {
if (OwnedAppIDs == null) {
throw new InvalidOperationException(nameof(OwnedAppIDs));
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 4bab71a

Please sign in to comment.