fixed up some jack things

This commit is contained in:
Kade M
2021-06-05 16:44:43 -07:00
parent 4154de886d
commit 666d96ea57

View File

@ -2872,36 +2872,43 @@ class PlayState extends MusicBeatState
var possibleNotes:Array<Note> = []; // notes that can be hit var possibleNotes:Array<Note> = []; // notes that can be hit
var directionList:Array<Int> = []; // directions that can be hit var directionList:Array<Int> = []; // directions that can be hit
var dumbNotes:Array<Note> = []; // notes to kill later var dumbNotes:Array<Note> = []; // notes to kill later
var directionsAccounted:Array<Bool> = [false,false,false,false]; // we don't want to do judgments for more than one presses
notes.forEachAlive(function(daNote:Note) notes.forEachAlive(function(daNote:Note)
{ {
if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit) 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) directionsAccounted[daNote.noteData] = true;
{ // if it's the same note twice at < 10ms distance, just delete it for (coolNote in possibleNotes)
// EXCEPT u cant delete it in this loop cuz it fucks with the collection lol {
dumbNotes.push(daNote); if (coolNote.noteData == daNote.noteData && Math.abs(daNote.strumTime - coolNote.strumTime) < 10)
break; { // 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
else if (coolNote.noteData == daNote.noteData && daNote.strumTime < coolNote.strumTime) dumbNotes.push(daNote);
{ // if daNote is earlier than existing note (coolNote), replace break;
possibleNotes.remove(coolNote); }
possibleNotes.push(daNote); else if (coolNote.noteData == daNote.noteData && daNote.strumTime < coolNote.strumTime)
break; { // if daNote is earlier than existing note (coolNote), replace
possibleNotes.remove(coolNote);
possibleNotes.push(daNote);
break;
}
} }
} }
} else
else {
{ possibleNotes.push(daNote);
possibleNotes.push(daNote); directionList.push(daNote.noteData);
directionList.push(daNote.noteData); }
} }
} }
}); });
trace('\nCURRENT LINE:\n' + directionsAccounted);
for (note in dumbNotes) for (note in dumbNotes)
{ {