Skip to content

Commit 6c53ec1

Browse files
committed
Merge pull request #102297 from KoBeWi/lost_modified_time
Update modified time when reloading script
2 parents 021e07c + a65fa94 commit 6c53ec1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

editor/plugins/script_editor_plugin.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -2826,19 +2826,19 @@ void ScriptEditor::_reload_scripts(bool p_refresh_only) {
28262826
}
28272827

28282828
if (!p_refresh_only) {
2829-
uint64_t last_date = edited_res->get_last_modified_time();
2829+
uint64_t last_date = se->edited_file_data.last_modified_time;
28302830
uint64_t date = FileAccess::get_modified_time(edited_res->get_path());
28312831

28322832
if (last_date == date) {
28332833
continue;
28342834
}
2835+
se->edited_file_data.last_modified_time = date;
28352836

28362837
Ref<Script> scr = edited_res;
28372838
if (scr.is_valid()) {
28382839
Ref<Script> rel_scr = ResourceLoader::load(scr->get_path(), scr->get_class(), ResourceFormatLoader::CACHE_MODE_IGNORE);
28392840
ERR_CONTINUE(rel_scr.is_null());
28402841
scr->set_source_code(rel_scr->get_source_code());
2841-
scr->set_last_modified_time(rel_scr->get_last_modified_time());
28422842
scr->reload(true);
28432843

28442844
update_docs_from_script(scr);
@@ -2849,7 +2849,6 @@ void ScriptEditor::_reload_scripts(bool p_refresh_only) {
28492849
Ref<JSON> rel_json = ResourceLoader::load(json->get_path(), json->get_class(), ResourceFormatLoader::CACHE_MODE_IGNORE);
28502850
ERR_CONTINUE(rel_json.is_null());
28512851
json->parse(rel_json->get_parsed_text(), true);
2852-
json->set_last_modified_time(rel_json->get_last_modified_time());
28532852
}
28542853

28552854
Ref<TextFile> text_file = edited_res;

0 commit comments

Comments
 (0)