From b5f25ef0576b0283e9e2cf0201a7336622f5d06d Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 5 Jul 2020 09:20:58 +0800 Subject: [PATCH] Fix assertion when resizing screen in result gui --- src/states_screens/race_result_gui.hpp | 2 +- src/tracks/track.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/states_screens/race_result_gui.hpp b/src/states_screens/race_result_gui.hpp index f32cfeb5c..c2e65bd8c 100644 --- a/src/states_screens/race_result_gui.hpp +++ b/src/states_screens/race_result_gui.hpp @@ -220,7 +220,7 @@ public: /** Should not be called anymore. */ const core::dimension2du getMiniMapSize() const OVERRIDE - { assert(false); return core::dimension2du(0, 0); } + { return core::dimension2du(0, 0); } /** No kart specific view needs to be rendered in the result gui. */ virtual void renderPlayerView(const Camera *camera, float dt) OVERRIDE {} diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 5df3f75d5..9eb6af9ba 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -1177,6 +1177,9 @@ void Track::updateMiniMapScale() return; core::dimension2du mini_map_size = World::getWorld()->getRaceGUI()->getMiniMapSize(); + // Happens in race result gui + if (mini_map_size.Width == 0 || mini_map_size.Height == 0) + return; core::dimension2du mini_map_texture_size = m_render_target->getTextureSize(); if(mini_map_texture_size.Width)