From a3441638c67c9a9f626d7542a53fef6340d42751 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Sun, 20 Aug 2017 20:24:26 +0200 Subject: [PATCH] Fix a formspec crash triggered by ae9b5e00989756bb676429530dfe81039009001c --- src/guiFormSpecMenu.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 4d1705d7e..996eeed53 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -2844,7 +2844,7 @@ void GUIFormSpecMenu::acceptInput(FormspecQuitMode quitmode=quit_mode_no) IGUIElement * element = getElementFromId(s.fid); gui::IGUIComboBox *e = NULL; if ((element) && (element->getType() == gui::EGUIET_COMBO_BOX)) { - e = dynamic_cast(element); + e = static_cast(element); } s32 selected = e->getSelected(); if (selected >= 0) { @@ -2857,11 +2857,11 @@ void GUIFormSpecMenu::acceptInput(FormspecQuitMode quitmode=quit_mode_no) } else if (s.ftype == f_TabHeader) { // no dynamic cast possible due to some distributions shipped - // without rtti support in irrlicht + // without rttzi support in irrlicht IGUIElement * element = getElementFromId(s.fid); gui::IGUITabControl *e = NULL; if ((element) && (element->getType() == gui::EGUIET_TAB_CONTROL)) { - e = dynamic_cast(element); + e = static_cast(element); } if (e != 0) { @@ -2876,7 +2876,7 @@ void GUIFormSpecMenu::acceptInput(FormspecQuitMode quitmode=quit_mode_no) IGUIElement * element = getElementFromId(s.fid); gui::IGUICheckBox *e = NULL; if ((element) && (element->getType() == gui::EGUIET_CHECK_BOX)) { - e = dynamic_cast(element); + e = static_cast(element); } if (e != 0) { @@ -2892,7 +2892,7 @@ void GUIFormSpecMenu::acceptInput(FormspecQuitMode quitmode=quit_mode_no) IGUIElement * element = getElementFromId(s.fid); gui::IGUIScrollBar *e = NULL; if ((element) && (element->getType() == gui::EGUIET_SCROLL_BAR)) { - e = dynamic_cast(element); + e = static_cast(element); } if (e != 0) { -- 2.25.1