You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #107850 from beicause/Fix-Resource-doesn't-update-when-overwritten-in-editor
Fix Resource doesn't update when overwritten in editor
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user