From 234b57497001c71927a614764ecad1fa4e76cddd Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 10 Jan 2004 21:07:12 +0000 Subject: [PATCH] fix crash on long rows --- stepmania/src/ScreenOptions.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 7caa933403..124ad15bc3 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -518,17 +518,14 @@ BitmapText &ScreenOptions::GetTextItemForRow( PlayerNumber pn, int iRow, int iCh if( row.Type == Row::ROW_EXIT ) return *row.m_textItems[0]; - if( !row.m_bRowIsLong ) - return *row.m_textItems[iChoiceOnRow]; - - const bool bOneChoice = m_Rows[iRow]->m_RowDef.bOneChoiceForAllPlayers; - - CHECKPOINT; - - if( bOneChoice ) - return *row.m_textItems[0]; + bool bOneChoice = m_Rows[iRow]->m_RowDef.bOneChoiceForAllPlayers; + int index = -1; + if( row.m_bRowIsLong ) + index = bOneChoice ? 0 : pn; else - return *row.m_textItems[iChoiceOnRow]; + index = iChoiceOnRow; + + return *row.m_textItems[index]; } void ScreenOptions::GetWidthXY( PlayerNumber pn, int iRow, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut )