diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-12-09 10:06:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-09 10:06:22 +0100 |
commit | 1a8741aacab634e8f8cfdbee0f6d83f20ca163d2 (patch) | |
tree | 66b19f42138f52af252bb8cf322501b35275f758 | |
parent | eac3885283eaec45fd30a3427b52153478926965 (diff) | |
parent | b0c807c75a0c45cf9a58381dea8a4ccf99c63dea (diff) |
Merge pull request #49473 from cptchuckles/fix-auto-reload-scripts
-rw-r--r-- | modules/gdscript/gdscript_cache.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index bb0d9e9e9b..e99bcddeb7 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -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); |