Print error if agent node is set after initialization
This commit is contained in:
parent
a2dae24b99
commit
84c89356a6
|
@ -93,6 +93,13 @@ void BTPlayer::set_behavior_tree(const Ref<BehaviorTree> &p_tree) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BTPlayer::set_agent_node(const NodePath &p_agent_node) {
|
||||||
|
agent_node = p_agent_node;
|
||||||
|
if (tree_instance.is_valid()) {
|
||||||
|
ERR_PRINT("BTPlayer: Agent node cannot be set after the behavior tree is instantiated. This change will not affect the behavior tree instance.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BTPlayer::set_blackboard_plan(const Ref<BlackboardPlan> &p_plan) {
|
void BTPlayer::set_blackboard_plan(const Ref<BlackboardPlan> &p_plan) {
|
||||||
blackboard_plan = p_plan;
|
blackboard_plan = p_plan;
|
||||||
_update_blackboard_plan();
|
_update_blackboard_plan();
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
void set_behavior_tree(const Ref<BehaviorTree> &p_tree);
|
void set_behavior_tree(const Ref<BehaviorTree> &p_tree);
|
||||||
Ref<BehaviorTree> get_behavior_tree() const { return behavior_tree; };
|
Ref<BehaviorTree> get_behavior_tree() const { return behavior_tree; };
|
||||||
|
|
||||||
void set_agent_node(const NodePath &p_agent_node) { agent_node = p_agent_node; }
|
void set_agent_node(const NodePath &p_agent_node);
|
||||||
NodePath get_agent_node() const { return agent_node; }
|
NodePath get_agent_node() const { return agent_node; }
|
||||||
|
|
||||||
void set_blackboard_plan(const Ref<BlackboardPlan> &p_plan);
|
void set_blackboard_plan(const Ref<BlackboardPlan> &p_plan);
|
||||||
|
|
Loading…
Reference in New Issue