From 916861e601240fa4d1d830ff7191b604ac48a33f Mon Sep 17 00:00:00 2001 From: FallBackITA27 Date: Fri, 12 Apr 2024 17:22:28 +0200 Subject: [PATCH] may be a dumb solution --- mkwpp-parser/script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkwpp-parser/script.js b/mkwpp-parser/script.js index 8501c4c..816ee22 100644 --- a/mkwpp-parser/script.js +++ b/mkwpp-parser/script.js @@ -280,14 +280,16 @@ document.getElementById("readInput").addEventListener("click", async function() for (let player of Object.keys(megamerge)) { let removal = new Set(); + let removedTimes = []; megamerge[player].sort((a,b)=>a.nosc - b.nosc).sort((a,b)=>(a.track*2 + a.flap)-(b.track*2 + b.flap)) for (let i in megamerge[player]) for (let j in megamerge[player]) { if (i == j) continue; let time = megamerge[player][i]; let cmpTime = megamerge[player][j]; if (time.track != cmpTime.track || time.flap != cmpTime.flap) continue; - if (time.time == cmpTime.time && !removal.has(i)) { + if (time.time == cmpTime.time && !removal.has(i) && !removedTimes.includes(time)) { removal.add(i); + removedTimes.push(time); writeToOutput(`Removed ${writeTimeOutput(time)}, it has been submitted twice.`); } else if (time.time < cmpTime.time) {