修复行为树关键bug

- 修复BehaviorTree.ts中lastOpenNodes的空指针风险
- 修复Ticker.ts中closeNode栈操作不对称问题
- 修复Agent.ts中subject参数传递错误

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
gongxh
2025-07-15 10:38:59 +08:00
parent 8015f3e7ea
commit 0d79db2c58
3 changed files with 7 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ export class BehaviorTree {
ticker.openNodes.length = 0;
this._root._execute(ticker);
// 上次打开的节点
let lastOpenNodes = blackboard.get("openNodes", this._id) as BaseNode[];
let lastOpenNodes = (blackboard.get("openNodes", this._id) || []) as BaseNode[];
// 当前打开的节点
let currOpenNodes = ticker.openNodes;
let start = 0;