implement RADAR_NUM_ROLLS to fix assertion failure

This commit is contained in:
Glenn Maynard
2005-04-25 10:01:39 +00:00
parent d7c686e726
commit c8f39053eb
+7 -3
View File
@@ -39,7 +39,7 @@ int GetNumNWithScore( const NoteData &in, TapNoteScore tns, int MinTaps, int iSt
return iNumSuccessfulDoubles; return iNumSuccessfulDoubles;
} }
int GetNumHoldNotesWithScore( const NoteData &in, HoldNoteScore hns ) int GetNumHoldNotesWithScore( const NoteData &in, TapNote::SubType subType, HoldNoteScore hns )
{ {
int iNumSuccessfulHolds = 0; int iNumSuccessfulHolds = 0;
for( int t=0; t<in.GetNumTracks(); ++t ) for( int t=0; t<in.GetNumTracks(); ++t )
@@ -52,6 +52,8 @@ int GetNumHoldNotesWithScore( const NoteData &in, HoldNoteScore hns )
const TapNote &tn = begin->second; const TapNote &tn = begin->second;
if( tn.type != TapNote::hold_head ) if( tn.type != TapNote::hold_head )
continue; continue;
if( subType == TapNote::SubType_invalid || tn.subType != subType )
continue;
if( tn.HoldResult.hns == hns ) if( tn.HoldResult.hns == hns )
++iNumSuccessfulHolds; ++iNumSuccessfulHolds;
} }
@@ -251,7 +253,7 @@ float GetActualFreezeRadarValue( const NoteData &in, float fSongSeconds, PlayerN
if( iTotalHolds == 0 ) if( iTotalHolds == 0 )
return 1.0f; return 1.0f;
const int ActualHolds = GetNumHoldNotesWithScore( in, HNS_OK ); const int ActualHolds = GetNumHoldNotesWithScore( in, TapNote::SubType_invalid, HNS_OK );
return clamp( float(ActualHolds) / iTotalHolds, 0.0f, 1.0f ); return clamp( float(ActualHolds) / iTotalHolds, 0.0f, 1.0f );
} }
@@ -273,9 +275,11 @@ void NoteDataWithScoring::GetActualRadarValues( const NoteData &in, PlayerNumber
case RADAR_CHAOS: out[rc] = GetActualChaosRadarValue( in, fSongSeconds, pn ); break; case RADAR_CHAOS: out[rc] = GetActualChaosRadarValue( in, fSongSeconds, pn ); break;
case RADAR_NUM_TAPS_AND_HOLDS: out[rc] = (float) GetNumNWithScore( in, TNS_GOOD, 1 ); break; case RADAR_NUM_TAPS_AND_HOLDS: out[rc] = (float) GetNumNWithScore( in, TNS_GOOD, 1 ); break;
case RADAR_NUM_JUMPS: out[rc] = (float) GetNumNWithScore( in, TNS_GOOD, 2 ); break; case RADAR_NUM_JUMPS: out[rc] = (float) GetNumNWithScore( in, TNS_GOOD, 2 ); break;
case RADAR_NUM_HOLDS: out[rc] = (float) GetNumHoldNotesWithScore( in, HNS_OK ); break; // XXX: This should be hold_head_hold, but that'll affect scoring.
case RADAR_NUM_HOLDS: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::SubType_invalid, HNS_OK ); break;
case RADAR_NUM_MINES: out[rc] = (float) GetSuccessfulMines( in ); break; case RADAR_NUM_MINES: out[rc] = (float) GetSuccessfulMines( in ); break;
case RADAR_NUM_HANDS: out[rc] = (float) GetSuccessfulHands( in ); break; case RADAR_NUM_HANDS: out[rc] = (float) GetSuccessfulHands( in ); break;
case RADAR_NUM_ROLLS: out[rc] = (float) GetNumHoldNotesWithScore( in, TapNote::hold_head_roll, HNS_OK ); break;
default: ASSERT(0); default: ASSERT(0);
} }
} }