From 14d1afc7d95002c8b5378910154f25743a4a2e4e Mon Sep 17 00:00:00 2001 From: xziino Date: Wed, 20 May 2026 16:23:30 +0200 Subject: [PATCH] Fix duplicate mitigation icons for self-buffing abilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Temperance (and similar abilities) have two status IDs in FFLogs — one for the caster's self-buff and one for the party aura. Both appeared in the buffs string causing double icons. Deduplicate by name in resolveMitigations. Co-Authored-By: Claude Sonnet 4.6 --- api/analysis.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/analysis.php b/api/analysis.php index 0a9d12a..7ce143e 100644 --- a/api/analysis.php +++ b/api/analysis.php @@ -84,11 +84,15 @@ const MITIGATION_ABILITIES = [ function resolveMitigations(string $buffStr, array $mitigIdMap): array { if ($buffStr === '') return []; $result = []; + $seen = []; foreach (explode('.', $buffStr) as $idStr) { $id = (int)$idStr; if (isset($mitigIdMap[$id])) { + $name = $mitigIdMap[$id]['name']; + if (isset($seen[$name])) continue; + $seen[$name] = true; $result[] = [ - 'name' => $mitigIdMap[$id]['name'], + 'name' => $name, 'dr' => $mitigIdMap[$id]['dr'], 'buffType' => $mitigIdMap[$id]['buffType'], ];