diff --git a/stepmania/src/NoteDataWithScoring.cpp b/stepmania/src/NoteDataWithScoring.cpp index efff845025..75b47a9394 100644 --- a/stepmania/src/NoteDataWithScoring.cpp +++ b/stepmania/src/NoteDataWithScoring.cpp @@ -129,7 +129,7 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex = /* Return the last tap score of a row: the grade of the tap that completed * the row. If the row has no tap notes, return -1. If any tap notes aren't * graded (any tap is TNS_None) or are missed (TNS_Miss), return it. */ -int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow ) +int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow, PlayerNumber pn ) { float scoretime = -9999; int best_track = -1; @@ -139,6 +139,8 @@ int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow ) const TapNote &tn = in.GetTapNote( t, iRow ); if( tn.type == TapNote::empty || tn.type == TapNote::mine ) continue; + if( tn.pn != PLAYER_INVALID && tn.pn != pn && pn != PLAYER_INVALID ) + continue; TapNoteScore tns = tn.result.tns; @@ -157,9 +159,9 @@ int LastTapNoteScoreTrack( const NoteData &in, unsigned iRow ) } -const TapNote &NoteDataWithScoring::LastTapNoteWithResult( const NoteData &in, unsigned iRow ) +const TapNote &NoteDataWithScoring::LastTapNoteWithResult( const NoteData &in, unsigned iRow, PlayerNumber pn ) { - int iTrack = LastTapNoteScoreTrack( in, iRow ); + int iTrack = LastTapNoteScoreTrack( in, iRow, pn ); if( iTrack == -1 ) return TAP_EMPTY; return in.GetTapNote( iTrack, iRow ); diff --git a/stepmania/src/NoteDataWithScoring.h b/stepmania/src/NoteDataWithScoring.h index b7f1e25a58..336acc40ea 100644 --- a/stepmania/src/NoteDataWithScoring.h +++ b/stepmania/src/NoteDataWithScoring.h @@ -4,6 +4,7 @@ #define NOTEDATAWITHSCORING_H #include "NoteTypes.h" +#include "PlayerNumber.h" struct RadarValues; class NoteData; @@ -12,7 +13,7 @@ namespace NoteDataWithScoring { bool IsRowCompletelyJudged( const NoteData &in, unsigned iRow ); TapNoteScore MinTapNoteScore( const NoteData &in, unsigned iRow ); - const TapNote &LastTapNoteWithResult( const NoteData &in, unsigned iRow ); + const TapNote &LastTapNoteWithResult( const NoteData &in, unsigned iRow, PlayerNumber pn = PLAYER_INVALID ); void GetActualRadarValues( const NoteData &in, const PlayerStageStats &pss, float fSongSeconds, RadarValues& out ); };