Skip to content

Commit

Permalink
Hide empty memento sockets?
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis committed Jul 21, 2024
1 parent 98a6f9d commit d293e1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/app/inventory/__snapshots__/d2-stores.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27643,7 +27643,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "High-Impact Frame*",
"Perks 1": "Arrowhead Brake*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down Expand Up @@ -28325,7 +28325,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "Lightweight Frame*",
"Perks 1": "Chambered Compensator*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down Expand Up @@ -28697,7 +28697,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "Precision Frame*",
"Perks 1": "Fluted Barrel*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down Expand Up @@ -28883,7 +28883,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "Precision Frame*",
"Perks 1": "Extended Barrel*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down Expand Up @@ -30371,7 +30371,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "Lightweight Frame*",
"Perks 1": "Arrowhead Brake*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down Expand Up @@ -30495,7 +30495,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "Precision Frame*",
"Perks 1": "Full Bore*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down Expand Up @@ -30557,7 +30557,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "High-Impact Frame*",
"Perks 1": "Corkscrew Rifling*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down Expand Up @@ -30619,7 +30619,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "High-Impact Frame*",
"Perks 1": "Chambered Compensator*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down Expand Up @@ -30805,7 +30805,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = `
"Owner": "Vault",
"Perks 0": "Adaptive Frame*",
"Perks 1": "Extended Barrel*",
"Perks 10": "Empty Memento Socket*",
"Perks 10": undefined,
"Perks 11": undefined,
"Perks 12": undefined,
"Perks 13": undefined,
Expand Down
7 changes: 5 additions & 2 deletions src/app/utils/socket-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
armor2PlugCategoryHashes,
} from 'app/search/d2-known-values';
import { DestinySocketCategoryStyle, TierType } from 'bungie-api-ts/destiny2';
import { emptyPlugHashes } from 'data/d2/empty-plug-hashes';
import {
BucketHashes,
ItemCategoryHashes,
Expand Down Expand Up @@ -297,8 +298,10 @@ function filterSocketCategories(
*/
export function isSocketEmpty(socket: DimSocket) {
return (
socket.plugged?.plugDef.hash === socket.emptyPlugItemHash &&
socket.plugged?.plugDef.plug.plugCategoryHash !== PlugCategoryHashes.V400EmptyExoticMasterwork
socket.plugged &&
(socket.plugged.plugDef.hash === socket.emptyPlugItemHash ||
emptyPlugHashes.has(socket.plugged?.plugDef.hash)) &&
socket.plugged.plugDef.plug.plugCategoryHash !== PlugCategoryHashes.V400EmptyExoticMasterwork
);
}

Expand Down

0 comments on commit d293e1c

Please sign in to comment.