From c27d48d364706474533b66d9ef2caeb66f980730 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 31 Oct 2024 13:46:51 +0000 Subject: [PATCH] - Update for the top level pokemon double dipping --- Site/templates/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Site/templates/index.html b/Site/templates/index.html index 8538e94..c2185a4 100644 --- a/Site/templates/index.html +++ b/Site/templates/index.html @@ -802,17 +802,17 @@ // Update for evolution targets entry.querySelectorAll('.target-card').forEach(card => { if (card.dataset.pfic === pfic) { - updateTargetDisplay(card, entry, isCaught); + updateTargetDisplay(card, entry, isCaught, pfic); } }); // Update for direct matches if (entry.dataset.pfic === pfic) { - updateEntryDisplay(entry, isCaught); + updateEntryDisplay(entry, isCaught, pfic); } }); } - function updateEntryDisplay(entry, isCaught) { + function updateEntryDisplay(entry, isCaught, pfic) { const catchCount = entry.querySelector('.catch-count'); const targetCards = entry.querySelectorAll('.target-card'); let totalNeeded = 0; @@ -836,7 +836,7 @@ } }); - if (isCaught) { + if (isCaught && pfic == entry.dataset.pfic) { initialCount -= 1; } @@ -862,10 +862,10 @@ updateGameTotal(entry, isCaught); } - function updateTargetDisplay(card, parentEntry, isCaught) { + function updateTargetDisplay(card, parentEntry, isCaught, pfic) { const targetImage = card.querySelector('.target-image'); targetImage.classList.toggle('grayscale', isCaught); - updateEntryDisplay(parentEntry, isCaught); + updateEntryDisplay(parentEntry, isCaught, pfic); } function updateGameTotal(entry, isCaught) {