Skip to content

Commit

Permalink
🐛 correctly interrupt SelectorStar and SequenceStar (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbrain authored Jan 13, 2023
1 parent 2595256 commit c60f32e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addons/beehave/nodes/composites/selector_star.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ func tick(actor: Node, blackboard: Blackboard) -> int:

last_execution_index = 0
return FAILURE

func interrupt(actor: Node, blackboard: Blackboard) -> void:
last_execution_index = 0
super(actor, blackboard)
4 changes: 4 additions & 0 deletions addons/beehave/nodes/composites/sequence_star.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ func tick(actor: Node, blackboard: Blackboard) -> int:
else:
successful_index = 0
return FAILURE

func interrupt(actor: Node, blackboard: Blackboard) -> void:
successful_index = 0
super(actor, blackboard)
12 changes: 12 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ _global_script_classes=[{
"path": "res://addons/beehave/nodes/composites/selector.gd"
}, {
"base": "Composite",
"class": &"SelectorRandomComposite",
"language": &"GDScript",
"path": "res://addons/beehave/nodes/composites/selector_random.gd"
}, {
"base": "Composite",
"class": &"SelectorStarComposite",
"language": &"GDScript",
"path": "res://addons/beehave/nodes/composites/selector_star.gd"
Expand All @@ -90,6 +95,11 @@ _global_script_classes=[{
"path": "res://addons/beehave/nodes/composites/sequence.gd"
}, {
"base": "Composite",
"class": &"SequenceRandomComposite",
"language": &"GDScript",
"path": "res://addons/beehave/nodes/composites/sequence_random.gd"
}, {
"base": "Composite",
"class": &"SequenceStarComposite",
"language": &"GDScript",
"path": "res://addons/beehave/nodes/composites/sequence_star.gd"
Expand All @@ -109,8 +119,10 @@ _global_script_class_icons={
"Leaf": "res://addons/beehave/icons/category_leaf.svg",
"LimiterDecorator": "res://addons/beehave/icons/limiter.svg",
"SelectorComposite": "res://addons/beehave/icons/selector.svg",
"SelectorRandomComposite": "res://addons/beehave/icons/selector_random.svg",
"SelectorStarComposite": "res://addons/beehave/icons/selector_reactive.svg",
"SequenceComposite": "res://addons/beehave/icons/sequence.svg",
"SequenceRandomComposite": "res://addons/beehave/icons/sequence_random.svg",
"SequenceStarComposite": "res://addons/beehave/icons/sequence_reactive.svg"
}

Expand Down

0 comments on commit c60f32e

Please sign in to comment.