Fix cancel not cancelling due to a dangling else ambiguity

This commit is contained in:
Jared Roberts
2002-09-16 22:33:44 +00:00
parent d07748481e
commit 3503c660f2
+6 -6
View File
@@ -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 )