Compare commits

..

1 Commits

Author SHA1 Message Date
Legendsmith 2a1ef95d4d
Merge bbdafa9033 into 106608aca9 2024-10-29 13:02:21 +01:00
1 changed files with 12 additions and 11 deletions

View File

@ -172,8 +172,9 @@ void BTTask::initialize(Node *p_agent, const Ref<Blackboard> &p_blackboard, Node
get_child(i)->initialize(p_agent, p_blackboard, p_scene_root);
}
_setup();
GDVIRTUAL_CALL(_setup);
if (!GDVIRTUAL_CALL(_setup)) {
_setup();
}
}
Ref<BTTask> BTTask::clone() const {
@ -234,9 +235,9 @@ BT::Status BTTask::execute(double p_delta) {
data.children.get(i)->abort();
}
}
// First native, then script.
_enter();
GDVIRTUAL_CALL(_enter);
if (!GDVIRTUAL_CALL(_enter)) {
_enter();
}
} else {
data.elapsed += p_delta;
}
@ -246,9 +247,9 @@ BT::Status BTTask::execute(double p_delta) {
}
if (data.status != RUNNING) {
// First script, then native.
GDVIRTUAL_CALL(_exit);
_exit();
if (!GDVIRTUAL_CALL(_exit)) {
_exit();
}
data.elapsed = 0.0;
}
return data.status;
@ -259,9 +260,9 @@ void BTTask::abort() {
get_child(i)->abort();
}
if (data.status == RUNNING) {
// First script, then native.
GDVIRTUAL_CALL(_exit);
_exit();
if (!GDVIRTUAL_CALL(_exit)) {
_exit();
}
}
data.status = FRESH;
data.elapsed = 0.0;