GDScript: Only move root scripts in cache

This commit is contained in:
HolonProduction 2026-01-06 18:45:16 +01:00
parent f0aeea26fb
commit 43a1a9464f

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