@@ -153,8 +153,15 @@ public void PlayNextFrame()
153153 {
154154 var obj = Map . GetHitObjectAtJudgementIndex ( i ) ;
155155
156- var hitStat = new HitStat ( HitStatType . Miss , KeyPressType . None , obj , obj . StartTime ,
157- Judgement . Miss , int . MinValue , ScoreProcessor . Accuracy , ScoreProcessor . Health ) ;
156+ var hitStat = obj . Type switch
157+ {
158+ HitObjectType . Normal => new HitStat ( HitStatType . Miss , KeyPressType . None , obj , obj . StartTime ,
159+ Judgement . Miss , int . MinValue , ScoreProcessor . Accuracy , ScoreProcessor . Health ) ,
160+ HitObjectType . Mine => new HitStat ( HitStatType . Hit , KeyPressType . None , obj , obj . StartTime ,
161+ Judgement . Marv , 0 , ScoreProcessor . Accuracy , ScoreProcessor . Health ) ,
162+ _ => throw new ArgumentOutOfRangeException ( nameof ( obj . Type ) , obj . Type ,
163+ "Unhandled note type" )
164+ } ;
158165
159166 ScoreProcessor . CalculateScore ( hitStat ) ;
160167
@@ -230,6 +237,8 @@ private void HandleKeyPressesInFrame()
230237 // Handle mines that were hit between frames.
231238 // The previous frame's pressed keys are held up until now, so [previousFrameTime..Time)
232239 // is the interval to check for mine hits.
240+ // This covers the last frame too! see ReplayCapturer.Capture: it adds a frame if judgement count
241+ // does not match expected, forcing another call into this.
233242 foreach ( var lane in previousFramePressed )
234243 {
235244 foreach ( var mine in ActiveMines )
0 commit comments