Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing item category hashes as well #10939

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

* Also fixed armor not showing up in Organizer due to the Bungie data bug that had all armor as "unknown" class instead of Hunter/Titan/Warlock.

## 8.57.2 <span class="changelog-date">(2025-02-05)</span>

* Worked around a bug in the Bungie data that had all armor as "unknown" class instead of Hunter/Titan/Warlock.
Expand Down
19 changes: 18 additions & 1 deletion src/app/inventory/store/d2-item-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ export function makeItem(
}
}

let itemCategoryHashes = getItemCategoryHashes(itemDef);

let classType = itemDef.classType;

// We cannot trust the defined class of redacted items,
Expand Down Expand Up @@ -482,6 +484,21 @@ export function makeItem(
// Obviously a subclass is compatible with the Guardian holding it.
classType = owner.classType;
}
if (classType !== DestinyClass.Unknown) {
switch (classType) {
case DestinyClass.Hunter:
itemCategoryHashes = [...itemCategoryHashes, ItemCategoryHashes.Hunter];
break;
case DestinyClass.Titan:
itemCategoryHashes = [...itemCategoryHashes, ItemCategoryHashes.Titan];
break;
case DestinyClass.Warlock:
itemCategoryHashes = [...itemCategoryHashes, ItemCategoryHashes.Warlock];
break;
default:
break;
}
}
}

const createdItem: DimItem = {
Expand All @@ -493,7 +510,7 @@ export function makeItem(
// The bucket the item normally resides in (even though it may be in the vault/postmaster)
bucket: normalBucket,
hash: item.itemHash,
itemCategoryHashes: getItemCategoryHashes(itemDef),
itemCategoryHashes,
tier: D2ItemTiers[itemDef.inventory!.tierType] || 'Common',
isExotic: itemDef.inventory!.tierType === TierType.Exotic,
name,
Expand Down