Merge pull request #261 from limbonaut/fix-crash-with-vscode-and-gdextension

Fix crash with VSCode and GDExtension
This commit is contained in:
Serhii Snitsaruk 2024-12-17 23:54:21 +01:00 committed by GitHub
commit dddc713a3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -35,7 +35,7 @@ void BTNewScope::_set_parent_scope_plan_from_bt() {
ERR_FAIL_NULL(get_blackboard_plan()); ERR_FAIL_NULL(get_blackboard_plan());
Ref<BehaviorTree> bt = get_root()->editor_get_behavior_tree(); Ref<BehaviorTree> bt = get_root()->editor_get_behavior_tree();
ERR_FAIL_NULL(bt); 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 #endif // TOOLS_ENABLED

View File

@ -24,7 +24,7 @@ void LimboState::set_blackboard_plan(const Ref<BlackboardPlan> &p_plan) {
blackboard_plan = p_plan; blackboard_plan = p_plan;
if (Engine::get_singleton()->is_editor_hint() && blackboard_plan.is_valid()) { 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(); _update_blackboard_plan();
@ -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("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_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(_setup);
GDVIRTUAL_BIND(_enter); GDVIRTUAL_BIND(_enter);
GDVIRTUAL_BIND(_exit); GDVIRTUAL_BIND(_exit);