Skip to content

Commit

Permalink
Merge pull request #261 from limbonaut/fix-crash-with-vscode-and-gdex…
Browse files Browse the repository at this point in the history
…tension

Fix crash with VSCode and GDExtension
  • Loading branch information
limbonaut authored Dec 17, 2024
2 parents 6fecc1e + a5118eb commit dddc713
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bt/tasks/decorators/bt_new_scope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void BTNewScope::_set_parent_scope_plan_from_bt() {
ERR_FAIL_NULL(get_blackboard_plan());
Ref<BehaviorTree> bt = get_root()->editor_get_behavior_tree();
ERR_FAIL_NULL(bt);
get_blackboard_plan()->set_parent_scope_plan_provider(callable_mp(bt.ptr(), &BehaviorTree::get_blackboard_plan));
get_blackboard_plan()->set_parent_scope_plan_provider(Callable(bt.ptr(), "get_blackboard_plan"));
}
#endif // TOOLS_ENABLED

Expand Down
4 changes: 3 additions & 1 deletion hsm/limbo_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void LimboState::set_blackboard_plan(const Ref<BlackboardPlan> &p_plan) {
blackboard_plan = p_plan;

if (Engine::get_singleton()->is_editor_hint() && blackboard_plan.is_valid()) {
blackboard_plan->set_parent_scope_plan_provider(callable_mp(this, &LimboState::_get_parent_scope_plan));
blackboard_plan->set_parent_scope_plan_provider(Callable(this, "_get_parent_scope_plan"));
}

_update_blackboard_plan();
Expand Down Expand Up @@ -213,6 +213,8 @@ void LimboState::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_blackboard_plan", "plan"), &LimboState::set_blackboard_plan);
ClassDB::bind_method(D_METHOD("get_blackboard_plan"), &LimboState::get_blackboard_plan);

ClassDB::bind_method(D_METHOD("_get_parent_scope_plan"), &LimboState::_get_parent_scope_plan);

GDVIRTUAL_BIND(_setup);
GDVIRTUAL_BIND(_enter);
GDVIRTUAL_BIND(_exit);
Expand Down

0 comments on commit dddc713

Please sign in to comment.