Change risky cast into dynamic_cast, fixing crash

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14627 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2013-12-04 01:38:29 +00:00
parent 46bb243955
commit a358c4d8ee

View File

@ -1364,7 +1364,7 @@ void Skin::drawSpinnerChild(const core::recti &rect, Widget* widget,
void Skin::drawIconButton(const core::recti &rect, Widget* widget,
const bool pressed, bool focused)
{
RibbonWidget* parentRibbon = (RibbonWidget*)widget->m_event_handler;
RibbonWidget* parentRibbon = dynamic_cast<RibbonWidget*>(widget->m_event_handler);
IGUIElement* focusedElem = NULL;
if (GUIEngine::getFocusForPlayer(PLAYER_ID_GAME_MASTER) != NULL)
{