Skip to content

Commit

Permalink
Merge pull request #10939 from DestinyItemManager/fix-organizer
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis authored Feb 5, 2025
2 parents 705b9dc + e0f8308 commit 5f20963
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
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

0 comments on commit 5f20963

Please sign in to comment.