From 2a179a03809bf3a694509ed8e92ed0b8dc7539e3 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 29 Jun 2005 07:57:15 +0000 Subject: [PATCH] Backing out of the final stage prevents getting extra stage. Backing out of extra stage (or second extra stage) fails the stage. --- stepmania/src/GameState.cpp | 5 +++++ stepmania/src/GameState.h | 3 ++- stepmania/src/ScreenGameplay.cpp | 11 +++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 1b0c5e28a0..409582e5f2 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -254,6 +254,8 @@ void GameState::Reset() m_pEditSourceSteps.Set( NULL ); m_stEditSource.Set( STEPS_TYPE_INVALID ); m_iEditCourseEntryIndex.Set( -1 ); + + m_bBackedOutOfFinalStage = false; ApplyCmdline(); } @@ -967,6 +969,9 @@ bool GameState::HasEarnedExtraStage() const if( this->m_PlayMode != PLAY_MODE_REGULAR ) return false; + + if( m_bBackedOutOfFinalStage ) + return false; if( (this->IsFinalStage() || this->IsExtraStage()) ) { diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index 225c8d4423..9fe6c16563 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -144,7 +144,8 @@ public: Course* m_pPreferredCourse; BroadcastOnChangePtr1D m_pCurTrail; - + bool m_bBackedOutOfFinalStage; + // // Music statistics: Arcade: the current stage (one song). Oni/Endles: a single song in a course // diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index e1b7e4821b..e8d9fe35d6 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1823,7 +1823,15 @@ void ScreenGameplay::BackOutFromGameplay() m_soundAssistTick.StopPlaying(); /* Stop any queued assist ticks. */ this->ClearMessageQueue(); - m_Cancel.StartTransitioning( SM_GoToScreenAfterBack ); + + // If this is the final stage, don't allow extra stage + if( GAMESTATE->IsFinalStage() ) + GAMESTATE->m_bBackedOutOfFinalStage = true; + // Disallow backing out of extra stage + if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) + SCREENMAN->PostMessageToTopScreen( SM_BeginFailed, 0 ); + else + m_Cancel.StartTransitioning( SM_GoToScreenAfterBack ); } void ScreenGameplay::AbortGiveUp( bool bShowText ) @@ -2288,7 +2296,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) float fMaxSurviveSeconds = 0; FOREACH_EnabledPlayer(p) fMaxSurviveSeconds = max( fMaxSurviveSeconds, STATSMAN->m_CurStageStats.m_player[p].fAliveSeconds ); - ASSERT( fMaxSurviveSeconds > 0 ); m_textSurviveTime.SetText( "TIME: " + SecondsToMMSSMsMs(fMaxSurviveSeconds) ); SET_XY_AND_ON_COMMAND( m_textSurviveTime ); }