From 4e231f5be38f2fd1266d038ce5ce5bf0ede12577 Mon Sep 17 00:00:00 2001 From: Sara Date: Fri, 31 May 2024 21:25:58 +0200 Subject: [PATCH] fix: switch_game_mode condition now first checks if a game mode is already active --- game_root.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game_root.cpp b/game_root.cpp index 71729ca..d36f8a8 100644 --- a/game_root.cpp +++ b/game_root.cpp @@ -119,7 +119,7 @@ Level3D *GameRoot3D::load_level_at(gd::Ref level, gd::Transform // store and add to tree at desired transform // if this is the first level containing a game mode currently active use it's gamemode as a prototype gd::Ref game_mode_prototype{instance->get_game_mode_prototype()}; - bool const switch_game_mode{this->game_mode->get_scene_file_path() != game_mode_prototype->get_path()}; + bool const switch_game_mode{!this->game_mode || this->game_mode->get_scene_file_path() != game_mode_prototype->get_path()}; if(switch_game_mode) { this->set_game_mode(instance->get_game_mode_prototype()); }