Skip to content

Commit 18c8de5

Browse files
authored
Merge pull request #370 from endlessm/push-msnptorpnqrl
Don't warn when BlockCode script extends parent script
2 parents d6ce937 + 055fce7 commit 18c8de5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addons/block_code/block_code_node/block_code.gd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ func _get_configuration_warnings():
8585
if get_parent() is BlockCode:
8686
warnings.append("The parent must not be a BlockCode.")
8787
if get_parent().script:
88-
warnings.append("This BlockCode will override the existing script in the parent node.")
88+
var parent_script_name: StringName = get_parent().script.get_global_name()
89+
if not (parent_script_name and block_script and parent_script_name == block_script.script_inherits):
90+
warnings.append("This BlockCode will override the existing script in the parent node.")
8991
if get_parent().find_children("*", "BlockCode", false).size() > 1:
9092
warnings.append("The parent should only contain one BlockCode.")
9193
if block_script and _get_custom_or_native_class(get_parent()) != block_script.script_inherits:

0 commit comments

Comments
 (0)