Merge pull request #114655 from HolonProduction/gdscript/back-to-the-roots

GDScript: Only move root scripts in cache
This commit is contained in:
Thaddeus Crews
2026-01-26 15:01:53 -06:00

View File

@@ -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<StringName, Ref<GDScript>> &kv : subclasses) {
kv.value->set_path(p_path, p_take_over);