fix lastHopoCol not set after each Hopo
Play TNS command only on the shortest string when playing a chord
This commit is contained in:
+23
-10
@@ -1092,9 +1092,9 @@ void Player::Fret( int col, int row, const RageTimer &tm, bool bHeld, bool bRele
|
|||||||
fPositionSeconds <= m_pPlayerState->m_fLastHopoNoteMusicSeconds + HOPO_CHAIN_SECONDS;
|
fPositionSeconds <= m_pPlayerState->m_fLastHopoNoteMusicSeconds + HOPO_CHAIN_SECONDS;
|
||||||
if( bDoHopo )
|
if( bDoHopo )
|
||||||
{
|
{
|
||||||
// do a Hopo if:
|
// do a Hopo:
|
||||||
// pressed fret if no higher fret is held
|
// - on pressed fret is no higher fret is held
|
||||||
// on next lowest pressed fret when the highest held fret is released
|
// - on next lowest held fret when the highest held fret is released
|
||||||
bool bHigherFretIsDown = false;
|
bool bHigherFretIsDown = false;
|
||||||
for( int i=col+1; i<m_NoteData.GetNumTracks(); i++ )
|
for( int i=col+1; i<m_NoteData.GetNumTracks(); i++ )
|
||||||
{
|
{
|
||||||
@@ -1141,6 +1141,11 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
|
|||||||
if( IsOniDead() )
|
if( IsOniDead() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Do everything that depends on a RageTime here and set your breakpoints somewhere after this block
|
||||||
|
const float fLastBeatUpdate = GAMESTATE->m_LastBeatUpdate.Ago();
|
||||||
|
const float fPositionSeconds = GAMESTATE->m_fMusicSeconds - tm.Ago();
|
||||||
|
const float fTimeSinceStep = tm.Ago();
|
||||||
|
|
||||||
switch( pbt )
|
switch( pbt )
|
||||||
{
|
{
|
||||||
DEFAULT_FAIL(pbt);
|
DEFAULT_FAIL(pbt);
|
||||||
@@ -1155,7 +1160,6 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float fPositionSeconds = GAMESTATE->m_fMusicSeconds - tm.Ago();
|
|
||||||
const float fSongBeat = GAMESTATE->m_pCurSong ? GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ) : GAMESTATE->m_fSongBeat;
|
const float fSongBeat = GAMESTATE->m_pCurSong ? GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ) : GAMESTATE->m_fSongBeat;
|
||||||
const int iSongRow = row == -1 ? BeatToNoteRow( fSongBeat ) : row;
|
const int iSongRow = row == -1 ? BeatToNoteRow( fSongBeat ) : row;
|
||||||
|
|
||||||
@@ -1305,11 +1309,11 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
|
|||||||
if( row == -1 )
|
if( row == -1 )
|
||||||
{
|
{
|
||||||
/* We actually stepped on the note this long ago: */
|
/* We actually stepped on the note this long ago: */
|
||||||
const float fTimeSinceStep = tm.Ago();
|
//fTimeSinceStep
|
||||||
|
|
||||||
/* GAMESTATE->m_fMusicSeconds is the music time as of GAMESTATE->m_LastBeatUpdate. Figure
|
/* GAMESTATE->m_fMusicSeconds is the music time as of GAMESTATE->m_LastBeatUpdate. Figure
|
||||||
* out what the music time is as of now. */
|
* out what the music time is as of now. */
|
||||||
const float fCurrentMusicSeconds = GAMESTATE->m_fMusicSeconds + (GAMESTATE->m_LastBeatUpdate.Ago()*GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate);
|
const float fCurrentMusicSeconds = GAMESTATE->m_fMusicSeconds + (fLastBeatUpdate*GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate);
|
||||||
|
|
||||||
/* ... which means it happened at this point in the music: */
|
/* ... which means it happened at this point in the music: */
|
||||||
const float fMusicSeconds = fCurrentMusicSeconds - fTimeSinceStep * GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
|
const float fMusicSeconds = fCurrentMusicSeconds - fTimeSinceStep * GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
|
||||||
@@ -1527,6 +1531,7 @@ done_checking_hopo:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_pPlayerState->m_fLastHopoNoteMusicSeconds = fStepSeconds;
|
m_pPlayerState->m_fLastHopoNoteMusicSeconds = fStepSeconds;
|
||||||
|
m_pPlayerState->m_iLastHopoNoteCol = col;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1671,16 +1676,24 @@ done_checking_hopo:
|
|||||||
{
|
{
|
||||||
DEFAULT_FAIL(pbt);
|
DEFAULT_FAIL(pbt);
|
||||||
case ButtonType_Strum:
|
case ButtonType_Strum:
|
||||||
for( int i=0; i<m_NoteData.GetNumTracks(); i++ )
|
|
||||||
{
|
{
|
||||||
if( m_vbFretIsDown[i] )
|
// only pulse the shortest string fret
|
||||||
m_pNoteField->Step( i, score );
|
int iLastFret = -1;
|
||||||
|
for( int i=0; i<m_NoteData.GetNumTracks(); i++ )
|
||||||
|
{
|
||||||
|
if( m_vbFretIsDown[i] )
|
||||||
|
iLastFret = i;
|
||||||
|
}
|
||||||
|
if( iLastFret != -1 )
|
||||||
|
m_pNoteField->Step( iLastFret, score );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ButtonType_Step:
|
case ButtonType_Step:
|
||||||
case ButtonType_Hopo:
|
|
||||||
m_pNoteField->Step( col, score );
|
m_pNoteField->Step( col, score );
|
||||||
break;
|
break;
|
||||||
|
case ButtonType_Hopo:
|
||||||
|
// no animation
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MESSAGEMAN->Broadcast( m_sMessageToSendOnStep );
|
MESSAGEMAN->Broadcast( m_sMessageToSendOnStep );
|
||||||
|
|||||||
Reference in New Issue
Block a user