Skip to content
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
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"source.organizeImports": "never"
}
},
"jest.jestCommandLine": "pnpm test --",
"jest.runMode": "on-demand",
"cSpell.enabledLanguageIds": ["jsonc", "json", "markdown"],
"cSpell.allowCompoundWords": true,
Expand Down
9 changes: 9 additions & 0 deletions api/stately/loadouts-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ export function statConstraintsFromStately(statConstraints: StatelyStatConstrain
if (c.maxTier !== 10) {
constraint.maxTier = c.maxTier;
}
if (c.minStat !== 0) {
constraint.minStat = c.minStat;
}
// This is the tricky one - an undefined value means max stat 200
if (c.maxStat !== 200 && c.maxStat !== 0) {
constraint.maxStat = c.maxStat;
}
return constraint;
});

Expand Down Expand Up @@ -275,6 +282,8 @@ export function statConstraintsToStately(statConstraints: StatConstraint[] | und
statHash: c.statHash,
minTier: Math.max(0, Math.floor(c.minTier ?? 0)),
maxTier: Math.min(Math.ceil(c.maxTier ?? 10), 10),
minStat: Math.max(0, Math.floor(c.minStat ?? 0)),
maxStat: Math.min(Math.ceil(c.maxStat ?? 200), 200),
}))
: [];
}
Expand Down