diff --git a/js/analysis.js b/js/analysis.js index ffc0de5..96d262a 100644 --- a/js/analysis.js +++ b/js/analysis.js @@ -508,7 +508,7 @@ })() : ''; const currentMitigKeys = new Set((t.mitigations ?? []).map(m => m.key ?? m.name)); - const refTarget = refEv?.targets?.find(rt => rt.name === t.name); + const refTarget = refEv?.targets?.find(rt => t.type ? rt.type === t.type : rt.name === t.name); const missingMitigs = refTarget ? (refTarget.mitigations ?? []).filter(m => m.buffType === 'buff' && !currentMitigKeys.has(m.key ?? m.name)) : []; @@ -561,8 +561,8 @@ (!playerFilter || t.name.toLowerCase().includes(playerFilter)) ); if (refVisible.length) { - const currentByName = {}; - ev.targets.forEach(t => { currentByName[t.name] = t; }); + const currentByType = {}; + ev.targets.forEach(t => { currentByType[t.type || t.name] = t; }); const seenRefDebuffKeys = new Set(); const refDebuffIconsHtml = refVisible.flatMap(t => (t.mitigations ?? [])) @@ -575,7 +575,7 @@ }).join(''); const refCards = refVisible.map(t => { - const curr = currentByName[t.name]; + const curr = currentByType[t.type || t.name]; const diff = curr ? curr.amount - t.amount : 0; const dead = t.hp === 0 && t.maxHp > 0;