Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
magicsea committed Nov 15, 2024
1 parent 4012d7c commit 9f40c7a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions core/BehaviorTree.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,12 @@ func (this *BehaviorTree) Tick(target interface{}, blackboard *Blackboard) b3.St
var currOpenNodes []IBaseNode
currOpenNodes = append(currOpenNodes, tick._openNodes...)

var same bool
l := len(lastOpenNodes)
if l == len(currOpenNodes) {
if l == 0 || lastOpenNodes[l-1] == currOpenNodes[l-1] {
same = true
return state
}
}
if same {
return state
}

// does not close if it is still open in this tick
var start = 0
Expand Down

0 comments on commit 9f40c7a

Please sign in to comment.