From e3aa689b7d5f9bdac8e4867470b82b467be81c92 Mon Sep 17 00:00:00 2001 From: Thai Pangsakulyanont Date: Wed, 16 Mar 2011 23:50:53 +0700 Subject: [PATCH] Make it play the right keysound on press. Improvements on hold notes. --- src/Player.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Player.cpp b/src/Player.cpp index f0a2489246..12b936a61f 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -2431,25 +2431,26 @@ done_checking_hopo: * even that doesn't seem quite right since it would then play the same (new) keysound twice which would * sound wrong even though the notes were judged as being correct, above. Fixing the above problem would * fix this one as well. */ - if( iRowOfOverlappingNoteOrRow == -1 ) + int iHeadRow; + if( iRowOfOverlappingNoteOrRow != -1 && score != TNS_None ) + { + // just pressing a note, use that row. + // in other words, iRowOfOverlappingNoteOrRow = iRowOfOverlappingNoteOrRow + } + else if ( m_NoteData.IsHoldNoteAtRow( col, iSongRow, &iHeadRow ) ) + { + // stepping on a hold, use it! + iRowOfOverlappingNoteOrRow = iHeadRow; + } + else + { + // or else find the closest note. iRowOfOverlappingNoteOrRow = GetClosestNote( col, iSongRow, MAX_NOTE_ROW, MAX_NOTE_ROW, true ); + } if( iRowOfOverlappingNoteOrRow != -1 ) { - int iPrevIndex = GetClosestNoteDirectional( col, iSongRow-MAX_NOTE_ROW, iSongRow, true, false ); bool bShouldPlayNextKeysound = true; - if( iPrevIndex != -1 ) - { - const TapNote &tn = m_NoteData.GetTapNote( col, iPrevIndex ); - if( tn.type == TapNote::hold_head ) - { - if( tn.HoldResult.bActive && tn.HoldResult.fOverlappedTime != 0 && tn.HoldResult.hns != HNS_Held ) - { - bShouldPlayNextKeysound = false; - } - } - } - if( bShouldPlayNextKeysound ) {