fix crash when going from ScreenSelectGameMode back to ScreenTitleMenu

This commit is contained in:
Chris Danford
2004-01-18 04:46:36 +00:00
parent c53f175d14
commit 5f0f5498bd
+15 -4
View File
@@ -73,14 +73,25 @@ void ScreenSelect::Update( float fDelta )
}
Screen::Update( fDelta );
int iSelection = this->GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber);
m_BGAnimations[iSelection].Update( fDelta );
// GAMESTATE->m_MasterPlayerNumber is set to PLAYER_INVALID when going Back to
// the title screen and this screen is updated after. TODO: find out why
if( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID )
{
int iSelection = this->GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber);
m_BGAnimations[iSelection].Update( fDelta );
}
}
void ScreenSelect::DrawPrimitives()
{
int iSelection = this->GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber);
m_BGAnimations[iSelection].Draw();
// GAMESTATE->m_MasterPlayerNumber is set to PLAYER_INVALID when going Back to
// the title screen and this screen is updated after. TODO: find out why
if( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID )
{
int iSelection = this->GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber);
m_BGAnimations[iSelection].Draw();
}
m_Menu.DrawBottomLayer();
Screen::DrawPrimitives();
m_Menu.DrawTopLayer();