Merge pull request #60642 from KoBeWi/‼️

Fix wrong condition checking for foreign resources
This commit is contained in:
Rémi Verschelde 2022-04-30 00:45:13 +02:00 committed by GitHub
commit 9b2ba9b8bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2980,7 +2980,7 @@ void EditorPropertyResource::_resource_selected(const RES &p_resource, bool p_ed
List<String> extensions;
ResourceLoader::get_recognized_extensions_for_type("PackedScene", &extensions);
if (extensions.find(parent.get_extension()) && (!EditorNode::get_singleton()->get_edited_scene() || EditorNode::get_singleton()->get_edited_scene()->get_scene_file_path() == parent)) {
if (extensions.find(parent.get_extension()) && (!EditorNode::get_singleton()->get_edited_scene() || EditorNode::get_singleton()->get_edited_scene()->get_scene_file_path() != parent)) {
// If the resource belongs to another scene, edit it in that scene instead.
EditorNode::get_singleton()->call_deferred("edit_foreign_resource", p_resource);
return;