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:
@@ -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" );
|
||||
|
||||
Reference in New Issue
Block a user