From 9a32bdcbe1b45bfe6170b053a6e85b0699a6f421 Mon Sep 17 00:00:00 2001 From: Benau Date: Wed, 18 Apr 2018 09:40:29 +0800 Subject: [PATCH] Fix #1636 --- src/states_screens/dialogs/race_paused_dialog.cpp | 2 ++ src/states_screens/race_gui_base.cpp | 9 +++++++++ src/states_screens/race_gui_base.hpp | 1 + 3 files changed, 12 insertions(+) diff --git a/src/states_screens/dialogs/race_paused_dialog.cpp b/src/states_screens/dialogs/race_paused_dialog.cpp index 7782409b9..c757e4c31 100644 --- a/src/states_screens/dialogs/race_paused_dialog.cpp +++ b/src/states_screens/dialogs/race_paused_dialog.cpp @@ -32,6 +32,7 @@ #include "race/race_manager.hpp" #include "states_screens/help_screen_1.hpp" #include "states_screens/main_menu_screen.hpp" +#include "states_screens/race_gui_base.hpp" #include "states_screens/race_setup_screen.hpp" #include "states_screens/options_screen_video.hpp" #include "states_screens/state_manager.hpp" @@ -187,6 +188,7 @@ GUIEngine::EventPropagation else if (selection == "endrace") { ModalDialog::dismiss(); + World::getWorld()->getRaceGUI()->removeReferee(); World::getWorld()->endRaceEarly(); return GUIEngine::EVENT_BLOCK; } diff --git a/src/states_screens/race_gui_base.cpp b/src/states_screens/race_gui_base.cpp index a4956b647..de1fdd021 100644 --- a/src/states_screens/race_gui_base.cpp +++ b/src/states_screens/race_gui_base.cpp @@ -1067,3 +1067,12 @@ void RaceGUIBase::drawPlungerInFace(const Camera *camera, float dt) true /* alpha */ ); #endif // !SERVER_ONLY } // drawPlungerInFace + +// ---------------------------------------------------------------------------- +void RaceGUIBase::removeReferee() +{ + if (m_referee->isAttached()) // race phase: + { + m_referee->removeFromSceneGraph(); + } +} // removeReferee diff --git a/src/states_screens/race_gui_base.hpp b/src/states_screens/race_gui_base.hpp index 72c4ee38f..889e0ddbd 100644 --- a/src/states_screens/race_gui_base.hpp +++ b/src/states_screens/race_gui_base.hpp @@ -248,6 +248,7 @@ public: const core::vector2df &scaling) {}; void cleanupMessages(const float dt); + void removeReferee(); }; // RaceGUIBase