simplify; use dynamic_cast

(dynamic_cast is safe as long as it's used only on pointer
values; do not use it on reference types, since that can throw)
This commit is contained in:
Glenn Maynard
2006-10-11 23:50:41 +00:00
parent 6fd4694b79
commit ebfdac231c
+1 -1
View File
@@ -26,7 +26,7 @@ void ComboGraph::LoadFromNode( const XNode* pNode )
m_pMaxComboText = (BitmapText *) this->GetChild( "MaxComboText" );
if( m_pMaxComboText == NULL )
RageException::Throw( "%s: ComboGraph: must have a child named \"MaxComboText\"", ActorUtil::GetWhere(pNode).c_str() );
if( !m_pMaxComboText->IsType("BitmapText") )
if( dynamic_cast<BitmapText *>(m_pMaxComboText) == NULL )
RageException::Throw( "%s: ComboGraph: \"MaxComboText\" child is not a BitmapText", ActorUtil::GetWhere(pNode).c_str() );
m_pNormalCombo = this->GetChild( "NormalCombo" );