Fix Resource doesn't update when overwritten in editor
This commit is contained in:
parent
4e6ac9bccc
commit
0c74c0978f
2 changed files with 11 additions and 6 deletions
|
|
@ -1585,7 +1585,13 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St
|
|||
return;
|
||||
}
|
||||
|
||||
((Resource *)p_resource.ptr())->set_path(path);
|
||||
Ref<Resource> prev_resource = ResourceCache::get_ref(p_path);
|
||||
if (prev_resource.is_null() || prev_resource != p_resource) {
|
||||
p_resource->set_path(path, true);
|
||||
}
|
||||
if (prev_resource.is_valid() && prev_resource != p_resource) {
|
||||
replace_resources_in_scenes({ prev_resource }, { p_resource });
|
||||
}
|
||||
saving_resources_in_path.erase(p_resource);
|
||||
|
||||
_resource_saved(p_resource, path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue