diff --git a/stepmania/src/ActiveAttackList.cpp b/stepmania/src/ActiveAttackList.cpp index 4d00413987..38e9bb8591 100644 --- a/stepmania/src/ActiveAttackList.cpp +++ b/stepmania/src/ActiveAttackList.cpp @@ -31,10 +31,9 @@ void ActiveAttackList::Update( float fDelta ) { BitmapText::Update( fDelta ); - // refresh text only once every 1/2 second - float fNowSeconds = RageTimer::GetTimeSinceStart(); - float fLastSeconds = RageTimer::GetTimeSinceStart() - fDelta; - bool bTimeToUpdate = froundf(fNowSeconds,0.5f) != froundf(fLastSeconds,0.5f); + bool bTimeToUpdate = + GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] || + GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber]; if( bTimeToUpdate ) { diff --git a/stepmania/src/AttackDisplay.cpp b/stepmania/src/AttackDisplay.cpp index f8ac33d770..dc48b3a788 100644 --- a/stepmania/src/AttackDisplay.cpp +++ b/stepmania/src/AttackDisplay.cpp @@ -85,7 +85,6 @@ void AttackDisplay::Update( float fDelta ) if( !GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] ) return; // don't handle this again - GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] = false; for( unsigned s=0; sm_ActiveAttacks[m_PlayerNumber].size(); s++ ) { diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 870c92ab52..11bca4bf9b 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -333,9 +333,13 @@ void GameState::Update( float fDelta ) { m_CurrentPlayerOptions[p].Approach( m_PlayerOptions[p], fDelta ); - bool bRebuildPlayerOptions = false; + // TRICKY: GAMESTATE->Update is run before any of the Screen update's, + // so we'll clear these flags here and let them get turned on later + m_bAttackBeganThisUpdate[p] = false; m_bAttackEndedThisUpdate[p] = false; + bool bRebuildPlayerOptions = false; + /* See if any delayed attacks are starting or ending. */ for( unsigned s=0; sTrace( "Launch attack '%s' against P%d at %f", a.sModifier.c_str(), target+1, a.fStartSecond ); - m_bAttackBeganThisUpdate[target] = true; - /* If fStartSecond is -1, it means "launch as soon as possible". For m_ActiveAttacks, * mark the real time it's starting (now), so Update() can know when the attack started * so it can be removed later. For m_ModsToApply, leave the -1 in, so Player::Update diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 7728d4b10d..129d4c6789 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -244,6 +244,8 @@ void PlayerMinus::Update( float fDeltaTime ) if( GAMESTATE->m_pCurSong==NULL ) return; + if( GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] ) + m_soundAttackLaunch.Play(); if( GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber] ) m_soundAttackEnding.Play();