From b364bb830b64dc860c38d0a03fd94497bfcaabfc Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 25 Oct 2004 00:46:08 +0000 Subject: [PATCH] separate search for key to play --- stepmania/src/Player.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index c07ce6491e..523b109362 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -894,11 +894,6 @@ void PlayerMinus::Step( int col, RageTimer tm ) if( score != TNS_NONE ) m_NoteData.SetTapNoteOffset(col, iIndexOverlappingNote, -fNoteOffset); - if( tn.bKeysound ) - { - m_vKeysounds[tn.iKeysoundIndex].Play(); - } - if( GAMESTATE->m_PlayerController[m_PlayerNumber] == PC_HUMAN && score >= TNS_GREAT ) HandleAutosync(fNoteOffset); @@ -942,6 +937,19 @@ void PlayerMinus::Step( int col, RageTimer tm ) { m_pNoteField->Step( col, TNS_NONE ); } + + /* Search for keyed sounds separately. If we can't find a nearby note, search + * backwards indefinitely, and ignore grading. */ + iIndexOverlappingNote = GetClosestNote( col, fSongBeat, + 999999.f, + StepSearchDistance * GAMESTATE->m_fCurBPS * GAMESTATE->m_SongOptions.m_fMusicRate, + true ); + if( iIndexOverlappingNote != -1 ) + { + TapNote tn = m_NoteData.GetTapNote( col, iIndexOverlappingNote ); + if( tn.bKeysound ) + m_vKeysounds[tn.iKeysoundIndex].Play(); + } } void PlayerMinus::HandleAutosync(float fNoteOffset)