Call both native and script _enter/_exit in BTTask
This commit is contained in:
parent
632e26c922
commit
7feff38d6b
|
@ -234,9 +234,9 @@ BT::Status BTTask::execute(double p_delta) {
|
||||||
data.children.get(i)->abort();
|
data.children.get(i)->abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!GDVIRTUAL_CALL(_enter)) {
|
// First native, then script.
|
||||||
_enter();
|
_enter();
|
||||||
}
|
GDVIRTUAL_CALL(_enter);
|
||||||
} else {
|
} else {
|
||||||
data.elapsed += p_delta;
|
data.elapsed += p_delta;
|
||||||
}
|
}
|
||||||
|
@ -246,9 +246,9 @@ BT::Status BTTask::execute(double p_delta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.status != RUNNING) {
|
if (data.status != RUNNING) {
|
||||||
if (!GDVIRTUAL_CALL(_exit)) {
|
// First script, then native.
|
||||||
_exit();
|
GDVIRTUAL_CALL(_exit);
|
||||||
}
|
_exit();
|
||||||
data.elapsed = 0.0;
|
data.elapsed = 0.0;
|
||||||
}
|
}
|
||||||
return data.status;
|
return data.status;
|
||||||
|
@ -259,9 +259,9 @@ void BTTask::abort() {
|
||||||
get_child(i)->abort();
|
get_child(i)->abort();
|
||||||
}
|
}
|
||||||
if (data.status == RUNNING) {
|
if (data.status == RUNNING) {
|
||||||
if (!GDVIRTUAL_CALL(_exit)) {
|
// First script, then native.
|
||||||
_exit();
|
GDVIRTUAL_CALL(_exit);
|
||||||
}
|
_exit();
|
||||||
}
|
}
|
||||||
data.status = FRESH;
|
data.status = FRESH;
|
||||||
data.elapsed = 0.0;
|
data.elapsed = 0.0;
|
||||||
|
|
Loading…
Reference in New Issue