Replaced simple cast with proper dynamic cast to avoid potential incorrect cast

problems (I can't figure out what this line is supposed to do ... as far as I
could see it appears not to be used at all, and m_phase never reaches FINISH_PHASE).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11188 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2012-05-06 23:54:53 +00:00
parent 70a49e4922
commit 48bac59013

View File

@ -226,8 +226,10 @@ void WorldStatus::update(const float dt)
// Wait for the race over GUI/modal dialog to appear
// Previously the in race race over results are shown,
// and getCurrent() returns NULL.
GUIEngine::ModalDialog *m = GUIEngine::ModalDialog::getCurrent();
if( m && ( (RaceOverDialog*)m)->menuIsFinished() )
RaceOverDialog *m =
dynamic_cast<RaceOverDialog*>(GUIEngine::ModalDialog
::getCurrent());
if( m && m->menuIsFinished() )
{
m_phase = FINISH_PHASE;
}