diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-03-08 19:46:55 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-08 19:46:55 +0100 |
commit | 496bd94c21dbda01fc7d9d0a108eecef21924024 (patch) | |
tree | 3bbe014b6c190541075e2a235487919d4453a771 /modules/gdscript/gdscript.cpp | |
parent | bed6c1dc4913b7137ba5dca814544c58f8dd34e0 (diff) | |
download | redot-engine-496bd94c21dbda01fc7d9d0a108eecef21924024.tar.gz |
Prevent cache corruption when saving resources in the editor
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index b6caefbdb5..1a1d021dbc 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1010,12 +1010,14 @@ void GDScript::_bind_methods() { } void GDScript::set_path(const String &p_path, bool p_take_over) { - String old_path = path; if (is_root_script()) { Script::set_path(p_path, p_take_over); } - this->path = p_path; + + String old_path = path; + path = p_path; GDScriptCache::move_script(old_path, p_path); + for (KeyValue<StringName, Ref<GDScript>> &kv : subclasses) { kv.value->set_path(p_path, p_take_over); } |