Skip to content

Commit 9f40c7a

Browse files
committed
优化
1 parent 4012d7c commit 9f40c7a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

core/BehaviorTree.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,16 +295,12 @@ func (this *BehaviorTree) Tick(target interface{}, blackboard *Blackboard) b3.St
295295
var currOpenNodes []IBaseNode
296296
currOpenNodes = append(currOpenNodes, tick._openNodes...)
297297

298-
var same bool
299298
l := len(lastOpenNodes)
300299
if l == len(currOpenNodes) {
301300
if l == 0 || lastOpenNodes[l-1] == currOpenNodes[l-1] {
302-
same = true
301+
return state
303302
}
304303
}
305-
if same {
306-
return state
307-
}
308304

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

0 commit comments

Comments
 (0)