Skip to content

Commit

Permalink
Fix auto reload scripts on external change
Browse files Browse the repository at this point in the history
  • Loading branch information
cptchuckles committed Sep 3, 2021
1 parent c39d318 commit b0c807c
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 @@ -198,7 +198,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 b0c807c

Please sign in to comment.