Skip to content

Commit 20c0f6e

Browse files
StarexifyHundrec
authored andcommitted
Fix health not being fully reset when restarting song through pause menu. Also health values during onSongRetry are now be the correct values instead of the old ones
1 parent 4366fbe commit 20c0f6e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

source/funkin/play/PlayState.hx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,8 @@ class PlayState extends MusicBeatSubState
996996

997997
currentStage?.resetStage();
998998

999+
resetHealth();
1000+
9991001
dispatchEvent(retryEvent);
10001002

10011003
resetCamera();
@@ -1057,7 +1059,6 @@ class PlayState extends MusicBeatSubState
10571059
hudCameraZoomIntensity = (cameraBopIntensity - 1.0) * 2.0;
10581060
cameraZoomRate = Constants.DEFAULT_ZOOM_RATE;
10591061

1060-
health = Constants.HEALTH_STARTING;
10611062
songScore = 0;
10621063
Highscore.tallies.combo = 0;
10631064

@@ -1386,10 +1387,7 @@ class PlayState extends MusicBeatSubState
13861387
songScore = 0;
13871388
updateScoreText();
13881389

1389-
health = Constants.HEALTH_STARTING;
1390-
healthLerp = health;
1391-
1392-
healthBar.value = healthLerp;
1390+
resetHealth();
13931391

13941392
if (!isMinimalMode)
13951393
{
@@ -2618,6 +2616,15 @@ class PlayState extends MusicBeatSubState
26182616
}
26192617
}
26202618

2619+
/**
2620+
* Reset the player's health and health bar to their starting values
2621+
*/
2622+
function resetHealth():Void
2623+
{
2624+
health = healthLerp = Constants.HEALTH_STARTING;
2625+
healthBar.value = 0;
2626+
}
2627+
26212628
/**
26222629
* Callback executed when one of the note keys is pressed.
26232630
*/

0 commit comments

Comments
 (0)