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) {