diff --git a/bt/bt_state.cpp b/bt/bt_state.cpp index 1202a8a..dee8e34 100644 --- a/bt/bt_state.cpp +++ b/bt/bt_state.cpp @@ -73,7 +73,7 @@ void BTState::_exit() { } void BTState::_update(double p_delta) { - VCALL_ARGS(_update, p_delta); + GDVIRTUAL_CALL(_update, p_delta); if (!is_active()) { // Bail out if a transition happened in the meantime. return; diff --git a/bt/tasks/bt_task.cpp b/bt/tasks/bt_task.cpp index 818999b..99224ca 100644 --- a/bt/tasks/bt_task.cpp +++ b/bt/tasks/bt_task.cpp @@ -129,13 +129,13 @@ String BTTask::get_task_name() { ERR_FAIL_COND_V_MSG(has_generate_method && !task_script->is_tool(), _generate_name(), vformat("BTTask: @tool annotation is required if _generate_name is defined: %s", task_script->get_path())); if (task_script->is_tool() && has_generate_method) { String call_result; - VCALL_V(_generate_name, call_result); + GDVIRTUAL_CALL(_generate_name, call_result); if (call_result.is_empty() || call_result == "") { // Force reset script instance. set_script(Variant()); set_script(task_script); // Retry. - VCALL_V(_generate_name, call_result); + GDVIRTUAL_CALL(_generate_name, call_result); } ERR_FAIL_COND_V_MSG(call_result.is_empty() || call_result == "", _generate_name(), vformat("BTTask: _generate_name() failed to return a proper name string (%s)", task_script->get_path())); return call_result; @@ -171,7 +171,9 @@ void BTTask::initialize(Node *p_agent, const Ref &p_blackboard, Node get_child(i)->initialize(p_agent, p_blackboard, p_scene_root); } - VCALL_OR_NATIVE(_setup); + if (!GDVIRTUAL_CALL(_setup)) { + _setup(); + } } Ref BTTask::clone() const { @@ -245,16 +247,21 @@ BT::Status BTTask::execute(double p_delta) { data.children.get(i)->abort(); } } - - VCALL_OR_NATIVE(_enter); + if (!GDVIRTUAL_CALL(_enter)) { + _enter(); + } } else { data.elapsed += p_delta; } - VCALL_OR_NATIVE_ARGS_V(_tick, Status, data.status, p_delta); + if (!GDVIRTUAL_CALL(_tick, p_delta, data.status)) { + data.status = _tick(p_delta); + } if (data.status != RUNNING) { - VCALL_OR_NATIVE(_exit); + if (!GDVIRTUAL_CALL(_exit)) { + _exit(); + } data.elapsed = 0.0; } return data.status; @@ -265,7 +272,9 @@ void BTTask::abort() { get_child(i)->abort(); } if (data.status == RUNNING) { - VCALL_OR_NATIVE(_exit); + if (!GDVIRTUAL_CALL(_exit)) { + _exit(); + } } data.status = FRESH; data.elapsed = 0.0; @@ -356,7 +365,7 @@ PackedStringArray BTTask::get_configuration_warnings() { PackedStringArray warnings; Ref