Skip to content

Commit

Permalink
Merge pull request #49473 from cptchuckles/fix-auto-reload-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Dec 9, 2021
2 parents eac3885 + b0c807c commit 1a8741a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/gdscript/gdscript_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,15 @@ Ref<GDScript> GDScriptCache::get_full_script(const String &p_path, Error &r_erro

r_error = OK;
if (singleton->full_gdscript_cache.has(p_path)) {
return singleton->full_gdscript_cache[p_path];
Ref<GDScript> script = singleton->full_gdscript_cache[p_path];
#ifdef TOOLS_ENABLED
uint64_t mt = FileAccess::get_modified_time(p_path);
if (script->get_last_modified_time() == mt) {
return script;
}
#else
return script;
#endif //TOOLS_ENABLED
}

Ref<GDScript> script = get_shallow_script(p_path);
Expand Down

0 comments on commit 1a8741a

Please sign in to comment.