From 3503c660f2dbcaecbfb8ecd6a75c1f18580ecf77 Mon Sep 17 00:00:00 2001 From: Jared Roberts Date: Mon, 16 Sep 2002 22:33:44 +0000 Subject: [PATCH] Fix cancel not cancelling due to a dangling else ambiguity --- stepmania/src/ScreenTextEntry.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index b7254398dc..7a05ea68f8 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -32,6 +32,7 @@ ScreenTextEntry::ScreenTextEntry( ScreenMessage SM_SendWhenDone, CString sQuesti m_pOnOK = OnOK; m_pOnCancel = OnCancel; m_sAnswer = sInitialAnswer; + m_bCancelled = false; m_Fade.SetTransitionTime( 0.5f ); m_Fade.SetDiffuse( D3DXCOLOR(0,0,0,0.7f) ); @@ -149,12 +150,11 @@ void ScreenTextEntry::MenuStart( PlayerNumber pn ) SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu start") ); - if( m_bCancelled ) - if( m_pOnCancel ) - m_pOnCancel(); - else - if( m_pOnOK ) - m_pOnOK( m_sAnswer ); + if( m_bCancelled ) { + if( m_pOnCancel ) m_pOnCancel(); + } else { + if( m_pOnOK ) m_pOnOK( m_sAnswer ); + } } void ScreenTextEntry::MenuBack( PlayerNumber pn )