Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare localized path against editor scene path when reloading #99741

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3960,7 +3960,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
return OK;
}

String lpath = ResourceUID::ensure_path(p_scene);
String lpath = ProjectSettings::get_singleton()->localize_path(ResourceUID::ensure_path(p_scene));
if (!p_set_inherited) {
for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
if (editor_data.get_scene_path(i) == lpath) {
Expand All @@ -3978,7 +3978,6 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
}
}

lpath = ProjectSettings::get_singleton()->localize_path(lpath);
if (!lpath.begins_with("res://")) {
show_accept(TTR("Error loading scene, it must be inside the project path. Use 'Import' to open the scene, then save it inside the project path."), TTR("OK"));
opening_prev = false;
Expand Down Expand Up @@ -5925,8 +5924,11 @@ void EditorNode::_notify_nodes_scene_reimported(Node *p_node, Array p_reimported

void EditorNode::reload_scene(const String &p_path) {
int scene_idx = -1;

String lpath = ProjectSettings::get_singleton()->localize_path(p_path);

for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
if (editor_data.get_scene_path(i) == p_path) {
if (editor_data.get_scene_path(i) == lpath) {
scene_idx = i;
break;
}
Expand Down