From 02d8bc45e85d282fc5806a991175d0f132631604 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 13 Mar 2004 22:41:31 +0000 Subject: [PATCH] fix stopping before the last note can be missed, especially in course modes --- stepmania/src/Player.h | 4 ++-- stepmania/src/ScreenGameplay.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 11225554dc..540b15ee69 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -58,6 +58,8 @@ public: void SetCharacterState(int iDCState) { m_iDCState = iDCState; }; void ApplyWaitingTransforms(); + static float GetMaxStepDistanceSeconds(); + protected: void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); void OnRowCompletelyJudged( int iStepIndex ); @@ -70,8 +72,6 @@ protected: int GetClosestNoteDirectional( int col, float fBeat, float fMaxBeatsAhead, int iDirection ) const; int GetClosestNote( int col, float fBeat, float fMaxBeatsAhead, float fMaxBeatsBehind ) const; - static float GetMaxStepDistanceSeconds(); - PlayerNumber m_PlayerNumber; float m_fNoteFieldHeight; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 4cd2653a27..f0a0de9fd2 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -89,7 +89,7 @@ const ScreenMessage SM_StopHereWeGo = ScreenMessage(SM_User+41); ScreenGameplay::ScreenGameplay( CString sName, bool bDemonstration ) : Screen(sName) { - m_bDemonstration = bDemonstration; + m_bDemonstration = bDemonstration; Init(); // work around horrible gcc bug 3187 } @@ -1226,6 +1226,10 @@ void ScreenGameplay::Update( float fDeltaTime ) // Check for end of song // float fSecondsToStop = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fLastBeat ); + + /* Make sure we keep going long enough to register a miss for the last note. */ + fSecondsToStop += PlayerMinus::GetMaxStepDistanceSeconds(); + if( GAMESTATE->m_fMusicSeconds > fSecondsToStop && !m_SongFinished.IsTransitioning() && !m_NextSongOut.IsTransitioning() ) m_SongFinished.StartTransitioning( SM_NotesEnded );