From d0c2daeadbb228f58c9cf1b68dcb51c26d446c9c Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 15 Jul 2005 07:19:36 +0000 Subject: [PATCH] fix crash when no choices due to m_iChoiceInRowWithFocus not being set to -1 yet --- stepmania/src/OptionRow.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 66675c9216..737cf1abe9 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -279,11 +279,6 @@ void OptionRow::InitText() BitmapText *bt = new BitmapText( m_textItemParent ); m_textItems.push_back( bt ); - const int iChoiceInRowWithFocus = m_iChoiceInRowWithFocus[p]; - - CString sText = (iChoiceInRowWithFocus==-1) ? "" : m_RowDef.m_vsChoices[iChoiceInRowWithFocus]; - PrepareItemText( sText ); - bt->SetText( sText ); bt->RunCommands( ITEMS_ON_COMMAND ); bt->SetShadowLength( 0 ); @@ -418,6 +413,8 @@ void OptionRow::AfterImportOptions() if( m_bFirstItemGoesDown ) FOREACH_PlayerNumber( p ) m_iChoiceInRowWithFocus[p] = 0; + + UpdateText(); } void OptionRow::LoadExit() @@ -504,6 +501,8 @@ void OptionRow::UpdateText() { unsigned pn = m_RowDef.m_bOneChoiceForAllPlayers ? 0 : p; int iChoiceWithFocus = m_iChoiceInRowWithFocus[pn]; + if( iChoiceWithFocus == -1 ) + continue; CString sText = m_RowDef.m_vsChoices[iChoiceWithFocus]; PrepareItemText( sText );