Clean up sacrifice candidate reasons
This commit is contained in:
@@ -358,7 +358,6 @@ function scorePiece(piece, profile, totals) {
|
|||||||
|
|
||||||
for (const effect of piece.effects) {
|
for (const effect of piece.effects) {
|
||||||
if (!effect.type) {
|
if (!effect.type) {
|
||||||
reasons.push("missing effect slot");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const def = effectById(effect.type);
|
const def = effectById(effect.type);
|
||||||
@@ -445,7 +444,10 @@ function renderUpgrades(profile, totals, currentDps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function renderSacrifices(pieceScores) {
|
function renderSacrifices(pieceScores) {
|
||||||
const weakest = [...pieceScores].sort((a, b) => a.score - b.score).slice(0, state.recommendationCount);
|
const weakest = pieceScores
|
||||||
|
.filter(({ piece }) => !piece.noEffects)
|
||||||
|
.sort((a, b) => a.score - b.score)
|
||||||
|
.slice(0, state.recommendationCount);
|
||||||
$("#sacrificeList").innerHTML = weakest.map(({ piece, score, reasons }) => `
|
$("#sacrificeList").innerHTML = weakest.map(({ piece, score, reasons }) => `
|
||||||
<li><strong>${escapeHtml(piece.name || piece.title)}</strong>
|
<li><strong>${escapeHtml(piece.name || piece.title)}</strong>
|
||||||
<small>Score ${fmt(score)}. ${reasons.length ? reasons.join("; ") : "Lowest relative contribution among entered pieces."}</small>
|
<small>Score ${fmt(score)}. ${reasons.length ? reasons.join("; ") : "Lowest relative contribution among entered pieces."}</small>
|
||||||
|
|||||||
Reference in New Issue
Block a user