From 666d96ea5753107eea65a74d02b7218fe0e01f5e Mon Sep 17 00:00:00 2001 From: Kade M Date: Sat, 5 Jun 2021 16:44:43 -0700 Subject: [PATCH] fixed up some jack things --- source/PlayState.hx | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 9c24a1d..3c8a088 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2872,36 +2872,43 @@ class PlayState extends MusicBeatState var possibleNotes:Array = []; // notes that can be hit var directionList:Array = []; // directions that can be hit var dumbNotes:Array = []; // notes to kill later - + var directionsAccounted:Array = [false,false,false,false]; // we don't want to do judgments for more than one presses + notes.forEachAlive(function(daNote:Note) { if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit) { - if (directionList.contains(daNote.noteData)) + if (!directionsAccounted[daNote.noteData]) { - for (coolNote in possibleNotes) + if (directionList.contains(daNote.noteData)) { - if (coolNote.noteData == daNote.noteData && Math.abs(daNote.strumTime - coolNote.strumTime) < 10) - { // if it's the same note twice at < 10ms distance, just delete it - // EXCEPT u cant delete it in this loop cuz it fucks with the collection lol - dumbNotes.push(daNote); - break; - } - else if (coolNote.noteData == daNote.noteData && daNote.strumTime < coolNote.strumTime) - { // if daNote is earlier than existing note (coolNote), replace - possibleNotes.remove(coolNote); - possibleNotes.push(daNote); - break; + directionsAccounted[daNote.noteData] = true; + for (coolNote in possibleNotes) + { + if (coolNote.noteData == daNote.noteData && Math.abs(daNote.strumTime - coolNote.strumTime) < 10) + { // if it's the same note twice at < 10ms distance, just delete it + // EXCEPT u cant delete it in this loop cuz it fucks with the collection lol + dumbNotes.push(daNote); + break; + } + else if (coolNote.noteData == daNote.noteData && daNote.strumTime < coolNote.strumTime) + { // if daNote is earlier than existing note (coolNote), replace + possibleNotes.remove(coolNote); + possibleNotes.push(daNote); + break; + } } } - } - else - { - possibleNotes.push(daNote); - directionList.push(daNote.noteData); + else + { + possibleNotes.push(daNote); + directionList.push(daNote.noteData); + } } } }); + + trace('\nCURRENT LINE:\n' + directionsAccounted); for (note in dumbNotes) {