Skip to content

Commit

Permalink
may be a dumb solution
Browse files Browse the repository at this point in the history
  • Loading branch information
FallBackITA27 committed Apr 12, 2024
1 parent 6d29fec commit 916861e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mkwpp-parser/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit 916861e

Please sign in to comment.