Add: More stuff to detur crashes.

This commit is contained in:
Charles Lohr
2005-01-24 03:11:00 +00:00
parent ed6aa8b02e
commit 72b0a3c330
3 changed files with 25 additions and 0 deletions
+19
View File
@@ -64,6 +64,9 @@ void ScreenNetEvaluation::RedoUserTexts()
m_iCurrentPlayer = 0;
for( int i=0; i<m_iActivePlayers; ++i )
this->RemoveChild( &m_textUsers[i] );
m_textUsers.resize(m_iActivePlayers);
for( int i=0; i<m_iActivePlayers; ++i )
@@ -127,6 +130,22 @@ void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM )
LOG->Trace("SMNETCheckpoint");
for( int i=0; i<m_iActivePlayers; ++i )
{
//Strange occourances because of timing
//cause these things not to work right
//and will sometimes cause a crash.
//We should make SURE we won't crash!
if ( i >= NSMAN->m_EvalPlayerData.size() )
break;
if ( NSMAN->m_EvalPlayerData[i].name >= NSMAN->m_PlayerNames.size() )
break;
if ( NSMAN->m_EvalPlayerData[i].name < 0 )
break;
if ( i >= m_textUsers.size() )
break;
m_textUsers[i].SetText( NSMAN->m_PlayerNames[NSMAN->m_EvalPlayerData[i].name] );
if ( NSMAN->m_EvalPlayerData[i].grade < GRADE_TIER_3 ) //Yes, hardcoded (I'd like to leave it that way)
m_textUsers[i].TurnRainbowOn();
+5
View File
@@ -88,12 +88,16 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenNetSe
NSMAN->ReportPlayerOptions();
m_bInitialSelect = false;
m_bAllowInput = false;
}
void ScreenNetSelectMusic::Input( const DeviceInput& DeviceI, const InputEventType type,
const GameInput& GameI, const MenuInput& MenuI,
const StyleInput& StyleI )
{
if( !m_bAllowInput )
return;
if( m_In.IsTransitioning() || m_Out.IsTransitioning() )
return;
@@ -232,6 +236,7 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
m_MusicWheel.Move(-1);
m_MusicWheel.Move(1);
m_MusicWheel.Select();
m_bAllowInput = true;
break;
case SM_BackFromOpts:
//XXX: HACK: This will causes ScreenSelectOptions to go back here.
+1
View File
@@ -86,6 +86,7 @@ private:
Song * m_cSong;
bool m_bInitialSelect;
bool m_bAllowInput;
};
#endif