-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 fix limiter node behaviour #250
Conversation
addons/beehave/nodes/beehave_tree.gd
Outdated
@@ -124,6 +124,8 @@ func _physics_process(delta: float) -> void: | |||
|
|||
|
|||
func tick() -> int: | |||
if actor == null: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there was a scenario where you can set a null
actor on a behaviour tree. In this case, the tree should not break the game but show a configuration warning.
@@ -10,7 +10,10 @@ class_name LimiterDecorator extends Decorator | |||
@export var max_count : float = 0 | |||
|
|||
func tick(actor: Node, blackboard: Blackboard) -> int: | |||
var child = self.get_child(0) | |||
if not get_child_count(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if for whatever reason there is no child node added to this node, we should skip this behaviour (and show a configuration warning)
|
||
|
||
func tick(actor: Node, blackboard: Blackboard) -> int: | ||
if not get_child_count(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if for whatever reason there is no child node added to this node, we should skip this behaviour (and show a configuration warning)
b8438cd
to
319eb1e
Compare
return | ||
|
||
if self.get_child_count() < 1: | ||
push_warning("BehaviorTree Error: Composite %s should have at least one child (NodePath: %s)" % [self.name, self.get_path()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_get_configuration_warnings
should be sufficient. No need to spam the console
@rxlecky I have adjusted the PR - it was previously not clear when exactly a |
Closes #247