1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Prevent cache corruption when saving resources in the editor

(cherry picked from commit 496bd94c21)
This commit is contained in:
Yuri Sizov
2023-03-08 19:46:55 +01:00
parent 7490f89238
commit 048c252602
3 changed files with 22 additions and 2 deletions

View File

@@ -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);
}