From 43a1a9464f0c364c479e651b7622e693955d637d Mon Sep 17 00:00:00 2001 From: HolonProduction Date: Tue, 6 Jan 2026 18:45:16 +0100 Subject: [PATCH] GDScript: Only move root scripts in cache --- modules/gdscript/gdscript.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index c75a70d3be..222eb53495 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1095,7 +1095,9 @@ void GDScript::set_path(const String &p_path, bool p_take_over) { String old_path = path; path = p_path; path_valid = true; - GDScriptCache::move_script(old_path, p_path); + if (is_root_script()) { + GDScriptCache::move_script(old_path, p_path); + } for (KeyValue> &kv : subclasses) { kv.value->set_path(p_path, p_take_over);