Skip to content

Commit

Permalink
fix several issues caused by sustain notes no longer being removed af…
Browse files Browse the repository at this point in the history
…ter correctly hit
  • Loading branch information
PrincessMtH committed Feb 20, 2021
1 parent f1d2fad commit 01e8800
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
8 changes: 2 additions & 6 deletions source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -171,26 +171,22 @@ class Note extends FlxSprite

if (mustPress)
{
// The * 0.5 us so that its easier to hit them too late, instead of too early
// The * 0.5 is so that it's easier to hit them too late, instead of too early
if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset
&& strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5))
{
canBeHit = true;
}
else
canBeHit = false;

if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset)
if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !wasGoodHit)
tooLate = true;
}
else
{
canBeHit = false;

if (strumTime <= Conductor.songPosition)
{
wasGoodHit = true;
}
}

if (tooLate)
Expand Down
31 changes: 12 additions & 19 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1563,27 +1563,18 @@ class PlayState extends MusicBeatState

if (daNote.y < -daNote.height)
{
if (daNote.isSustainNote && daNote.wasGoodHit)
if (daNote.tooLate || !daNote.wasGoodHit)
{
daNote.kill();
notes.remove(daNote, true);
daNote.destroy();
health -= 0.0475;
vocals.volume = 0;
}
else
{
if (daNote.tooLate || !daNote.wasGoodHit)
{
health -= 0.0475;
vocals.volume = 0;
}

daNote.active = false;
daNote.visible = false;
daNote.active = false;
daNote.visible = false;

daNote.kill();
notes.remove(daNote, true);
daNote.destroy();
}
daNote.kill();
notes.remove(daNote, true);
daNote.destroy();
}
});
}
Expand Down Expand Up @@ -1864,7 +1855,7 @@ class PlayState extends MusicBeatState

notes.forEachAlive(function(daNote:Note)
{
if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate)
if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit)
{
// the sorting probably doesn't need to be in here? who cares lol
possibleNotes.push(daNote);
Expand Down Expand Up @@ -1940,13 +1931,15 @@ class PlayState extends MusicBeatState
if (upP || rightP || downP || leftP)
noteCheck(leftP, daNote);
}
*/
//this is already done in noteCheck / goodNoteHit
if (daNote.wasGoodHit)
{
daNote.kill();
notes.remove(daNote, true);
daNote.destroy();
}
*/
}
else
{
Expand Down

0 comments on commit 01e8800

Please sign in to comment.