From 9cb560ae0314ae7ad1532798bddf4b1ec4e5fc99 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 8 Mar 2005 20:34:08 +0000 Subject: [PATCH] fix AV when change on SHOW_ONE and only P2 joined --- stepmania/src/OptionRow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 9c0b705784..d3e3ea8bce 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -471,7 +471,13 @@ void OptionRow::UpdateText() CString sText = m_RowDef.choices[iChoiceWithFocus]; if( CAPITALIZE_ALL_OPTION_NAMES ) sText.MakeUpper(); - m_textItems[pn]->SetText( sText ); + + // If player_no is 2 and there is no player 1: + int index = min( pn, m_textItems.size()-1 ); + + // TODO: Always have one textItem for each player + + m_textItems[index]->SetText( sText ); } break; }