Skip to content

Commit

Permalink
Merge pull request #10150 from grSalonga/loadout
Browse files Browse the repository at this point in the history
Unstackable mod fix
  • Loading branch information
bhollis authored Dec 6, 2023
2 parents d40f388 + 1a874d5 commit d556bbe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/loadout/ModPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { isClassCompatible, modMetadataByPlugCategoryHash } from 'app/utils/item
import { getSocketsByCategoryHash } from 'app/utils/socket-utils';
import { DestinyClass } from 'bungie-api-ts/destiny2';
import { PlugCategoryHashes, SocketCategoryHashes } from 'data/d2/generated-enums';
import unstackableModHashes from 'data/d2/unstackable-mods.json';
import { produce } from 'immer';
import _ from 'lodash';
import { useCallback, useMemo } from 'react';
Expand Down Expand Up @@ -336,6 +337,11 @@ function isModSelectable(
const { plugCategoryHash, energyCost } = mod.plug;
const isSlotSpecificCategory = slotSpecificPlugCategoryHashes.includes(plugCategoryHash);

// checks if the selected mod can stack with itself.
if (selected.includes(mod) && unstackableModHashes.includes(mod.hash)) {
return false;
}

// If there's an already selected mod that excludes this mod, we can't select this one
const exclusionGroup = getModExclusionGroup(mod);
if (exclusionGroup && selected.some((mod) => getModExclusionGroup(mod) === exclusionGroup)) {
Expand Down

0 comments on commit d556bbe

Please sign in to comment.