mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Prevent cache corruption when saving resources in the editor
This commit is contained in:
parent
bed6c1dc49
commit
496bd94c21
3 changed files with 22 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue