fix ScreenSelect loading screens two or three times (!) due to broken

"clear m_sScreen" logic
This commit is contained in:
Glenn Maynard
2005-04-26 05:39:12 +00:00
parent 4e6f00ba9e
commit 9c0679c738
3 changed files with 26 additions and 2 deletions
+23
View File
@@ -608,6 +608,29 @@ static HighScore MakeRandomHighScore( float fPercentDP )
return hs;
}
/* Hack: if this GameCommand would set the screen, clear the setting and return
* the screen that would have been set. */
CString GameCommand::GetAndClearScreen()
{
CString sRet;
FOREACH( Command, m_Commands.v, cmd )
{
GameCommand gc;
gc.m_bInvalid = false;
gc.LoadOne( *cmd );
if( gc.m_sScreen != "" )
{
sRet = gc.m_sScreen;
m_Commands.v.erase( cmd );
break;
}
}
m_sScreen = "";
return sRet;
}
void GameCommand::Apply( const vector<PlayerNumber> &vpns ) const
{
if( m_Commands.v.size() )