Skip to content

Commit

Permalink
Fix mixed tab/space usage (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Earewien authored Nov 27, 2024
1 parent 22603ec commit c212f1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
17 changes: 8 additions & 9 deletions addons/godot-traits/core/container/gtraits_container.gd
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ func _set_trait_container_type() -> void:
set_meta(GTraitsStorage.META_KEY_CONTAINER_TYPE, "Node")

func _on_child_order_changed() -> void:
# Check if the container is still in the tree
if not is_inside_tree():
return
for child in get_children():
# Check if invalid node is present or not
if child.get_meta(_META_KEY_NOT_A_TRAIT, false):
continue
# Check if the container is still in the tree
if not is_inside_tree():
return

for child in get_children():
# Check if invalid node is present or not
if child.get_meta(_META_KEY_NOT_A_TRAIT, false):
continue

# Flag invalid node
if not GTraitsTypeOracle.get_instance().is_trait(child.get_script()):
Expand Down Expand Up @@ -112,4 +112,3 @@ func _initialize_trait(a_trait_instance:Node) -> void:
while(parent_script != null):
trait_storage.store_trait_instance(receiver, a_trait_instance, parent_script)
parent_script = parent_script.get_base_script()

3 changes: 1 addition & 2 deletions addons/godot-traits/core/gtraits_storage.gd
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func _get_scene_trait_container_for(receiver:Node, trait_instance:Node) -> Node:
elif required_container_type == "Node2D":
container = preload("res://addons/godot-traits/core/container/gtraits_container_2d.tscn").instantiate()
#container.name = "GTraitsContainer2D"
elif required_container_type == "Node3D":
elif required_container_type == "Node3D":
container = preload("res://addons/godot-traits/core/container/gtraits_container_3d.tscn").instantiate()
#container.name = "GTraitsContainer3D"
else:
Expand All @@ -169,4 +169,3 @@ func _free_trait_instance(trait_instance:Object) -> void:
pass
else:
trait_instance.free()

0 comments on commit c212f1c

Please sign in to comment.