From fb1d893f5768c6bd46787a15a6f3c889b4ed2301 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 10 Mar 2005 03:53:00 +0000 Subject: [PATCH] tolerate no options being selectable --- stepmania/src/ScreenSelectMaster.cpp | 26 +++++++++++++++++++++++--- stepmania/src/ScreenSelectMaster.h | 1 + 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index d7b4101fe9..0eb01c1d28 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -340,16 +340,30 @@ void ScreenSelectMaster::UpdateSelectableChoices() for( int i=0; i seen; do @@ -614,6 +628,12 @@ void ScreenSelectMaster::MenuStart( PlayerNumber pn ) return; GameCommand &mc = m_aGameCommands[m_iChoice[pn]]; + + /* If no options are playable, then we're just waiting for one to become available. + * If any options are playable, then the selection must be playable. */ + if( !AnyOptionsArePlayable() ) + return; + SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("%s comment %s",m_sName.c_str(), mc.m_sName.c_str())) ); /* Play a copy of the sound, so it'll finish playing even if we leave the screen immediately. */ diff --git a/stepmania/src/ScreenSelectMaster.h b/stepmania/src/ScreenSelectMaster.h index 5e0d00af76..635ba8c97f 100644 --- a/stepmania/src/ScreenSelectMaster.h +++ b/stepmania/src/ScreenSelectMaster.h @@ -63,6 +63,7 @@ protected: virtual int GetSelectionIndex( PlayerNumber pn ); virtual void UpdateSelectableChoices(); + bool AnyOptionsArePlayable() const; bool Move( PlayerNumber pn, MenuDir dir ); bool ChangePage( int iNewChoice );