From 4d248c29f8bb84ff823e4c439a1bfafc3e304c2f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 1 Feb 2006 04:42:19 +0000 Subject: [PATCH] GAMESTATE->GetUndisplayedBeats-based path is moved to GetRealtimeAttackBeats. This was confusing: one of the callers of GetAttackBeats passed NULL as pPlayerState, since it's not used in fStartSecond is >= 0. This also eliminates GAMESTATE->GetUndisplayedBeats; that code path was weird, since GetAttackBeats took a pSong, but GetUndisplayedBeats always used GAMESTATE->m_pCurSong. --- stepmania/src/Attack.cpp | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/stepmania/src/Attack.cpp b/stepmania/src/Attack.cpp index 56be9016f3..ee30e182c6 100644 --- a/stepmania/src/Attack.cpp +++ b/stepmania/src/Attack.cpp @@ -9,31 +9,10 @@ void Attack::GetAttackBeats( const Song *pSong, const PlayerState* pPlayerState, float &fStartBeat, float &fEndBeat ) const { ASSERT( pSong ); + ASSERT_M( fStartSecond >= 0, ssprintf("%f",fStartSecond) ); - if( fStartSecond >= 0 ) - { - CHECKPOINT; - fStartBeat = pSong->GetBeatFromElapsedTime( fStartSecond ); - fEndBeat = pSong->GetBeatFromElapsedTime( fStartSecond+fSecsRemaining ); - } - else - { - CHECKPOINT; - /* If fStartSecond < 0, then the attack starts right off the screen; this requires - * that a song actually be playing. Pre-queued course attacks must always have - * fStartSecond >= 0. */ - ASSERT( GAMESTATE->m_pCurSong ); - - ASSERT( pPlayerState ); - - /* We're setting this effect on the fly. If it's an arrow-changing effect - * (transform or note skin), apply it in the future, after what's currently on - * screen, so new arrows will scroll on screen with this effect. */ - GAMESTATE->GetUndisplayedBeats( pPlayerState, fSecsRemaining, fStartBeat, fEndBeat ); - } - - // loading the course should have caught this. - ASSERT_M( fEndBeat >= fStartBeat, ssprintf("%f >= %f", fEndBeat, fStartBeat) ); + fStartBeat = pSong->GetBeatFromElapsedTime( fStartSecond ); + fEndBeat = pSong->GetBeatFromElapsedTime( fStartSecond+fSecsRemaining ); } /* Get the range for an attack that's being applied in realtime, eg. during battle