Merge pull request #69 from dpalais/root_parent_scope
Set parent scope in state initialization
This commit is contained in:
commit
fda6fd5b8f
|
@ -197,11 +197,7 @@ void LimboHSM::initialize(Node *p_agent, const Ref<Blackboard> &p_parent_scope)
|
||||||
ERR_FAIL_COND(p_agent == nullptr);
|
ERR_FAIL_COND(p_agent == nullptr);
|
||||||
ERR_FAIL_COND_MSG(!is_root(), "LimboHSM: initialize() must be called on the root HSM.");
|
ERR_FAIL_COND_MSG(!is_root(), "LimboHSM: initialize() must be called on the root HSM.");
|
||||||
|
|
||||||
if (!p_parent_scope.is_null()) {
|
_initialize(p_agent, p_parent_scope);
|
||||||
blackboard->set_parent(p_parent_scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
_initialize(p_agent, nullptr);
|
|
||||||
|
|
||||||
if (initial_state == nullptr) {
|
if (initial_state == nullptr) {
|
||||||
initial_state = Object::cast_to<LimboState>(get_child(0));
|
initial_state = Object::cast_to<LimboState>(get_child(0));
|
||||||
|
|
Loading…
Reference in New Issue