Skip to content

Commit

Permalink
Call both native and script _enter/_exit in BTTask
Browse files Browse the repository at this point in the history
  • Loading branch information
limbonaut committed Nov 1, 2024
1 parent 632e26c commit 7feff38
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions bt/tasks/bt_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ BT::Status BTTask::execute(double p_delta) {
data.children.get(i)->abort();
}
}
if (!GDVIRTUAL_CALL(_enter)) {
_enter();
}
// First native, then script.
_enter();
GDVIRTUAL_CALL(_enter);
} else {
data.elapsed += p_delta;
}
Expand All @@ -246,9 +246,9 @@ BT::Status BTTask::execute(double p_delta) {
}

if (data.status != RUNNING) {
if (!GDVIRTUAL_CALL(_exit)) {
_exit();
}
// First script, then native.
GDVIRTUAL_CALL(_exit);
_exit();
data.elapsed = 0.0;
}
return data.status;
Expand All @@ -259,9 +259,9 @@ void BTTask::abort() {
get_child(i)->abort();
}
if (data.status == RUNNING) {
if (!GDVIRTUAL_CALL(_exit)) {
_exit();
}
// First script, then native.
GDVIRTUAL_CALL(_exit);
_exit();
}
data.status = FRESH;
data.elapsed = 0.0;
Expand Down

0 comments on commit 7feff38

Please sign in to comment.