fix AV if character has no model

This commit is contained in:
Chris Danford
2003-10-12 20:00:22 +00:00
parent a2029876e7
commit 9b111c9058
+17 -13
View File
@@ -110,20 +110,24 @@ ScreenHowToPlay::ScreenHowToPlay( CString sName ) : ScreenAttract( sName )
{ {
Character* rndchar = GAMESTATE->GetRandomCharacter(); Character* rndchar = GAMESTATE->GetRandomCharacter();
m_pmCharacter = new Model; CString sModelPath = rndchar->GetModelPath();
m_pmCharacter->LoadMilkshapeAscii( rndchar->GetModelPath() ); if( sModelPath != "" )
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-LEFT", GetAnimPath( ANIM_LEFT ) ); {
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-DOWN", GetAnimPath( ANIM_DOWN ) ); m_pmCharacter = new Model;
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-UP", GetAnimPath( ANIM_UP ) ); m_pmCharacter->LoadMilkshapeAscii( rndchar->GetModelPath() );
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-RIGHT", GetAnimPath( ANIM_RIGHT ) ); m_pmCharacter->LoadMilkshapeAsciiBones( "Step-LEFT", GetAnimPath( ANIM_LEFT ) );
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-JUMPLR", GetAnimPath( ANIM_JUMPLR ) ); m_pmCharacter->LoadMilkshapeAsciiBones( "Step-DOWN", GetAnimPath( ANIM_DOWN ) );
m_pmCharacter->LoadMilkshapeAsciiBones( "rest",rndchar->GetRestAnimationPath() ); m_pmCharacter->LoadMilkshapeAsciiBones( "Step-UP", GetAnimPath( ANIM_UP ) );
m_pmCharacter->SetDefaultAnimation( "rest" ); m_pmCharacter->LoadMilkshapeAsciiBones( "Step-RIGHT", GetAnimPath( ANIM_RIGHT ) );
m_pmCharacter->PlayAnimation( "rest" ); m_pmCharacter->LoadMilkshapeAsciiBones( "Step-JUMPLR", GetAnimPath( ANIM_JUMPLR ) );
m_pmCharacter->m_bRevertToDefaultAnimation = true; // Stay bouncing after a step has finished animating. m_pmCharacter->LoadMilkshapeAsciiBones( "rest",rndchar->GetRestAnimationPath() );
m_pmCharacter->SetDefaultAnimation( "rest" );
m_pmCharacter->PlayAnimation( "rest" );
m_pmCharacter->m_bRevertToDefaultAnimation = true; // Stay bouncing after a step has finished animating.
m_pmCharacter->SetRotationX( 40 ); m_pmCharacter->SetRotationX( 40 );
m_pmCharacter->Command( CHARACTERONCOMMAND ); m_pmCharacter->Command( CHARACTERONCOMMAND );
}
} }
// silly to use the lifebar without a player, since the player updates the lifebar // silly to use the lifebar without a player, since the player updates the lifebar