Fix crash with one character.

This commit is contained in:
Glenn Maynard
2003-07-31 22:49:22 +00:00
parent 7deffd2de4
commit d6c88f2c3c
+5 -2
View File
@@ -52,8 +52,10 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay")
// Display character
if( GAMESTATE->m_pCharacters.size() )
{
int iRnd;
iRnd = rand() % (GAMESTATE->m_pCharacters.size()-1);
iRnd = rand() % ( GAMESTATE->m_pCharacters.size() );
if( iRnd != 0 )
{
m_mCharacter.LoadMilkshapeAscii( GAMESTATE->m_pCharacters[iRnd]->GetModelPath() );
@@ -62,6 +64,7 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay")
m_mCharacter.Command("X,150;Y,300;Zoom,15;RotationY,180;sleep,4.7;linear,1.0;RotationY,360;Zoom,20;X,100;Y,425");
this->AddChild(&m_mCharacter);
}
}
//
@@ -201,7 +204,7 @@ void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM )
{
case SM_BeginFadingOut:
/* We can't do this in ScreenHowToPlay::~ScreenHowToPlay, since that happens
* after the actor of the next screen; we don't want to mess with its state. */
* after the ctor of the next screen; we don't want to mess with its state. */
GAMESTATE->m_pCurSong = NULL;
break;
}