Skip to content

Commit ededa6f

Browse files
committed
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 18f2334 commit ededa6f

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
@@ -974,6 +974,8 @@ class PlayState extends MusicBeatSubState
974974

975975
currentStage?.resetStage();
976976

977+
resetHealth();
978+
977979
dispatchEvent(retryEvent);
978980

979981
resetCamera();
@@ -1035,7 +1037,6 @@ class PlayState extends MusicBeatSubState
10351037
hudCameraZoomIntensity = (cameraBopIntensity - 1.0) * 2.0;
10361038
cameraZoomRate = Constants.DEFAULT_ZOOM_RATE;
10371039

1038-
health = Constants.HEALTH_STARTING;
10391040
songScore = 0;
10401041
Highscore.tallies.combo = 0;
10411042

@@ -1361,10 +1362,7 @@ class PlayState extends MusicBeatSubState
13611362
songScore = 0;
13621363
updateScoreText();
13631364

1364-
health = Constants.HEALTH_STARTING;
1365-
healthLerp = health;
1366-
1367-
healthBar.value = healthLerp;
1365+
resetHealth();
13681366

13691367
if (!isMinimalMode)
13701368
{
@@ -2564,6 +2562,15 @@ class PlayState extends MusicBeatSubState
25642562
}
25652563
}
25662564

2565+
/**
2566+
* Reset the player's health and health bar to their starting values
2567+
*/
2568+
function resetHealth():Void
2569+
{
2570+
health = healthLerp = Constants.HEALTH_STARTING;
2571+
healthBar.value = 0;
2572+
}
2573+
25672574
/**
25682575
* Callback executed when one of the note keys is pressed.
25692576
*/

0 commit comments

Comments
 (0)