don't accumulate calories when hitting a mine due to a previously held button

This commit is contained in:
Glenn Maynard
2005-04-06 01:28:49 +00:00
parent 8f98d3ce66
commit 6b62ba5d1c
2 changed files with 9 additions and 8 deletions
+7 -6
View File
@@ -700,7 +700,7 @@ int Player::GetClosestNote( int col, int iNoteRow, int iMaxRowsAhead, int iMaxRo
}
void Player::Step( int col, const RageTimer &tm )
void Player::Step( int col, const RageTimer &tm, bool bHeld )
{
bool bOniDead =
GAMESTATE->m_SongOptions.m_LifeType == SongOptions::LIFE_BATTERY &&
@@ -709,12 +709,12 @@ void Player::Step( int col, const RageTimer &tm )
if( bOniDead )
return; // do nothing
HandleStep( col, tm );
HandleStep( col, tm, bHeld );
MESSAGEMAN->Broadcast( m_sMessageToSendOnStep );
}
void Player::HandleStep( int col, const RageTimer &tm )
void Player::HandleStep( int col, const RageTimer &tm, bool bHeld )
{
//LOG->Trace( "Player::HandlePlayerStep()" );
@@ -722,9 +722,10 @@ void Player::HandleStep( int col, const RageTimer &tm )
ASSERT_M( col >= 0 && col <= m_NoteData.GetNumTracks(), ssprintf("%i, %i", col, m_NoteData.GetNumTracks()) );
//
// Count calories for this step.
// Count calories for this step, unless we're being called because a button is
// held over a mine.
//
if( m_pPlayerStageStats && m_pPlayerState )
if( m_pPlayerStageStats && m_pPlayerState && !bHeld )
{
// TODO: remove use of PlayerNumber
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
@@ -1198,7 +1199,7 @@ void Player::CrossedMineRow( int iNoteRow )
{
bool bIsDown = INPUTMAPPER->IsButtonDown( GameI );
if( bIsDown )
Step( t, now );
Step( t, now, true );
}
}
}
+2 -2
View File
@@ -46,7 +46,7 @@ public:
void Load( const NoteData& noteData );
void CrossedRow( int iNoteRow );
void CrossedMineRow( int iNoteRow );
void Step( int col, const RageTimer &tm );
void Step( int col, const RageTimer &tm, bool bHeld = false );
void RandomizeNotes( int iNoteRow );
void FadeToFail();
TapNoteScore GetLastTapNoteScore() const { return m_LastTapNoteScore; }
@@ -58,7 +58,7 @@ public:
NoteData m_NoteData;
protected:
void HandleStep( int col, const RageTimer &tm );
void HandleStep( int col, const RageTimer &tm, bool bHeld );
void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
void OnRowCompletelyJudged( int iStepIndex );
void HandleTapRowScore( unsigned row );