Save scene when saving built-in resource

This commit is contained in:
kobewi 2023-11-08 21:08:24 +01:00
parent 59457685c1
commit da55c06322
2 changed files with 10 additions and 9 deletions

View file

@ -2520,15 +2520,7 @@ void ScriptEditor::save_current_script() {
clear_docs_from_script(scr);
}
if (resource->is_built_in()) {
// If built-in script, save the scene instead.
const String scene_path = resource->get_path().get_slice("::", 0);
if (!scene_path.is_empty()) {
EditorNode::get_singleton()->save_scene_if_open(scene_path);
}
} else {
EditorNode::get_singleton()->save_resource(resource);
}
EditorNode::get_singleton()->save_resource(resource);
if (scr.is_valid()) {
update_docs_from_script(scr);