Skip to content

Commit 5033a6a

Browse files
author
MarianoGnu
committed
Never duplicate Scripts when duplicating resources recursively
This allows to duplicate PackedScenes safely Fixes #108220
1 parent de463e0 commit 5033a6a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/io/resource.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ Variant Resource::_duplicate_recursive(const Variant &p_variant, const Duplicate
298298
DEV_ASSERT(false);
299299
}
300300
}
301+
if (should_duplicate) {
302+
Ref<Script> scr = sr;
303+
if (scr.is_valid()) {
304+
should_duplicate = false;
305+
}
306+
}
301307
}
302308
}
303309
if (should_duplicate) {

0 commit comments

Comments
 (0)