Skip to content

Commit

Permalink
Fix: Adapt usage of typed Arrays for RC1 (#119)
Browse files Browse the repository at this point in the history
Adapt usage of typed Arrays for RC1
  • Loading branch information
Werninator authored Feb 11, 2023
1 parent 4e3b6c3 commit e4de8f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion addons/beehave/blackboard.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ class_name Blackboard extends Node
var blackboard: Dictionary = {}

func keys() -> Array[String]:
return blackboard.keys().duplicate()
var keys: Array[String]
keys.assign(blackboard.keys().duplicate())
return keys


func set_value(key: Variant, value: Variant, blackboard_name: String = 'default') -> void:
Expand Down
3 changes: 2 additions & 1 deletion addons/beehave/nodes/composites/selector_random.gd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ func interrupt(actor: Node, blackboard: Blackboard) -> void:


func _get_reversed_indexes() -> Array[int]:
var reversed = range(_children_bag.size())
var reversed: Array[int]
reversed.assign(range(_children_bag.size()))
reversed.reverse()
return reversed

Expand Down
3 changes: 2 additions & 1 deletion addons/beehave/nodes/composites/sequence_random.gd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ func interrupt(actor: Node, blackboard: Blackboard) -> void:


func _get_reversed_indexes() -> Array[int]:
var reversed = range(_children_bag.size())
var reversed: Array[int]
reversed.assign(range(_children_bag.size()))
reversed.reverse()
return reversed

Expand Down

0 comments on commit e4de8f8

Please sign in to comment.