summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-01-14 12:17:32 +0100
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-01-14 12:17:32 +0100
commit595c6248a3e7d988e34d53635737e906c1eed819 (patch)
tree620c38b4ba590740ee8650a7d77fbbf20214c8a0
parent26b1fd0d842fa3c2f090ead47e8ea7cd2d6515e1 (diff)
downloadredot-engine-595c6248a3e7d988e34d53635737e906c1eed819.tar.gz
Fix reloading current scene forgetting path
Scene was stopped before running which cleared the last run scene, forcing it to run the currently edited scene instead
-rw-r--r--editor/gui/editor_run_bar.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/gui/editor_run_bar.cpp b/editor/gui/editor_run_bar.cpp
index 54fb60d074..a79dced69e 100644
--- a/editor/gui/editor_run_bar.cpp
+++ b/editor/gui/editor_run_bar.cpp
@@ -273,12 +273,13 @@ void EditorRunBar::play_main_scene(bool p_from_native) {
}
void EditorRunBar::play_current_scene(bool p_reload) {
+ String last_current_scene = run_current_filename; // This is necessary to have a copy of the string.
+
EditorNode::get_singleton()->save_default_environment();
stop_playing();
current_mode = RunMode::RUN_CURRENT;
if (p_reload) {
- String last_current_scene = run_current_filename; // This is necessary to have a copy of the string.
_run_scene(last_current_scene);
} else {
_run_scene();