Skip to content

Commit

Permalink
Fix bug where added traits using trait container not in SceneTree are…
Browse files Browse the repository at this point in the history
… not declared as traits (#16)

Regression from #13
  • Loading branch information
Earewien authored Nov 27, 2024
1 parent c212f1c commit 7470a06
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/godot-traits/core/container/gtraits_container.gd
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func _init() -> void:
# This callback is called before the trait _ready function and after it's _init function
# so it's perfect to invoke the trait _initialize function
child_order_changed.connect(_on_child_order_changed)
# Children added to this container outside SceneTree are not yet declared as trait
# So when this container is added to the scene tree, declare them as trait if needed
tree_entered.connect(_on_child_order_changed)

#------------------------------------------
# Public functions
Expand Down

0 comments on commit 7470a06

Please sign in to comment.