Skip to content

Commit

Permalink
Merge pull request #2683 from Hundrec/patch-1
Browse files Browse the repository at this point in the history
Fix botplay sustain release bug
  • Loading branch information
EliteMasterEric authored Jun 8, 2024
2 parents aace5e2 + 9a8ba41 commit 1956636
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2276,11 +2276,20 @@ class PlayState extends MusicBeatSubState
if (holdNote == null || !holdNote.alive) continue;

// While the hold note is being hit, and there is length on the hold note...
if (!isBotPlayMode && holdNote.hitNote && !holdNote.missedNote && holdNote.sustainLength > 0)
if (holdNote.hitNote && !holdNote.missedNote && holdNote.sustainLength > 0)
{
// Grant the player health.
health += Constants.HEALTH_HOLD_BONUS_PER_SECOND * elapsed;
songScore += Std.int(Constants.SCORE_HOLD_BONUS_PER_SECOND * elapsed);
if (!isBotPlayMode)
{
health += Constants.HEALTH_HOLD_BONUS_PER_SECOND * elapsed;
songScore += Std.int(Constants.SCORE_HOLD_BONUS_PER_SECOND * elapsed);
}

// Make sure the player keeps singing while the note is held by the bot.
if (isBotPlayMode && currentStage != null && currentStage.getBoyfriend() != null && currentStage.getBoyfriend().isSinging())
{
currentStage.getBoyfriend().holdTimer = 0;
}
}

if (holdNote.missedNote && !holdNote.handledMiss)
Expand Down

0 comments on commit 1956636

Please sign in to comment.