Add/Get name for nodes in behaviour tree

This commit is contained in:
2024-01-10 07:45:26 +01:00
parent 113ac72181
commit 3b77d5cdcf
3 changed files with 16 additions and 14 deletions

View File

@@ -31,7 +31,8 @@ bool init(int *game) {
BzBTNode *seq = bzBTCompSequence(nodePool, node, false);
bzBTDecorDelay(nodePool, seq, 1.0f);
bzBTAction(nodePool, seq, printAction, "printAction");
node = bzBTAction(nodePool, seq, printAction);
bzBTNodeSetName(node,"printAction");
agentState = bzBTCreateState(&(BzBTStateDesc) {
.root = printBT,
@@ -76,7 +77,7 @@ void igRenderBTNode(const BzBTNode *node, const BzBTNodeState *state, bool sameL
break;
case BZ_BT_ACTION:
snprintf(extraInfo, sizeof(extraInfo), " (%s:%p)",
bzBTActionGetName(node),
bzBTNodeGetName(node) ? bzBTNodeGetName(node) : "?",
bzBTActionGetFn(node));
break;
default: