Skip to content

Commit 6b48966

Browse files
committed
tuned stat fixes for exotics
1 parent e3c6e91 commit 6b48966

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/app/loadout-builder/process/mappers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ export function mapDimItemToProcessItems({
110110
const tuningSocket = getArmor3TuningSocket(dimItem);
111111

112112
// Make a version of the item for each possible tuning mod that could be applied.
113-
if (autoStatMods && tuningSocket?.reusablePlugItems?.length) {
113+
//
114+
// exclude tuning mods for exotics since they have so many tuning options that it blows up the combinations.
115+
//
116+
if (autoStatMods && !isExotic && tuningSocket?.reusablePlugItems?.length) {
114117
const processItems: ProcessItem[] = [];
115118
const allPlugs = tuningSocket.plugSet?.plugs;
116119
// By default, we'll sacrifice the last ignored stat, or the last from among the lowest maximums

src/app/loadout/mod-assignment-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ export function fitMostMods({
383383
// stats), so if we assigned them in a different order than they were chosen
384384
// in the process loop, we might end up with different stats than the user
385385
// expected.
386-
const tuningItems = items.filter((i) => getArmor3TuningStat(i) !== undefined);
386+
//
387+
// Exclude exotics since they blow up the combos since they have all the tuning sockets.
388+
//
389+
const tuningItems = items.filter((i) => !i.isExotic && getArmor3TuningStat(i) !== undefined);
387390
for (const tuningMod of tuningMods) {
388391
// Find the tuning stat hash, which is the stat that gets +5 when this mod
389392
// is applied. For "Balanced Tuning" this should be 0.

src/app/utils/item-utils.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,17 @@ export function getArmor3TuningStat(item: DimItem): StatHashes | undefined {
406406
return;
407407
}
408408

409+
let tunedStat: StatHashes | undefined;
409410
for (const { plugItemHash } of reusablePlugItems) {
410-
if (plugItemHash in tuningModToTunedStathash) {
411-
return tuningModToTunedStathash[plugItemHash];
411+
const stat = tuningModToTunedStathash[plugItemHash];
412+
if (stat !== undefined) {
413+
if (tunedStat !== undefined && tunedStat !== stat) {
414+
// Multiple different stat tuners available (e.g. exotics) --
415+
// this item isn't locked to a single tuning stat.
416+
return undefined;
417+
}
418+
tunedStat = stat;
412419
}
413420
}
414-
return undefined;
421+
return tunedStat;
415422
}

0 commit comments

Comments
 (0)