Skip to content

Commit

Permalink
Merge pull request #361 from endlessm/fix-356
Browse files Browse the repository at this point in the history
Warn when Block Code overrides parent script
  • Loading branch information
manuq authored Jan 24, 2025
2 parents 3dc22a2 + 87c31b0 commit 336383e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/block_code/block_code_node/block_code.gd
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ func _get_configuration_warnings():
warnings.append("A BlockCode must not be a root node.")
if get_parent() is BlockCode:
warnings.append("The parent must not be a BlockCode.")
if get_parent().script:
warnings.append("This BlockCode will override the existing script in the parent node.")
if get_parent().find_children("*", "BlockCode", false).size() > 1:
warnings.append("The parent should only contain one BlockCode.")
if block_script and _get_custom_or_native_class(get_parent()) != block_script.script_inherits:
Expand Down

0 comments on commit 336383e

Please sign in to comment.