Compare commits
1 Commits
1b9a81ad0c
...
2a1ef95d4d
Author | SHA1 | Date |
---|---|---|
Legendsmith | 2a1ef95d4d |
|
@ -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);
|
get_child(i)->initialize(p_agent, p_blackboard, p_scene_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
_setup();
|
if (!GDVIRTUAL_CALL(_setup)) {
|
||||||
GDVIRTUAL_CALL(_setup);
|
_setup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<BTTask> BTTask::clone() const {
|
Ref<BTTask> BTTask::clone() const {
|
||||||
|
@ -234,9 +235,9 @@ BT::Status BTTask::execute(double p_delta) {
|
||||||
data.children.get(i)->abort();
|
data.children.get(i)->abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// First native, then script.
|
if (!GDVIRTUAL_CALL(_enter)) {
|
||||||
_enter();
|
_enter();
|
||||||
GDVIRTUAL_CALL(_enter);
|
}
|
||||||
} else {
|
} else {
|
||||||
data.elapsed += p_delta;
|
data.elapsed += p_delta;
|
||||||
}
|
}
|
||||||
|
@ -246,9 +247,9 @@ BT::Status BTTask::execute(double p_delta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.status != RUNNING) {
|
if (data.status != RUNNING) {
|
||||||
// First script, then native.
|
if (!GDVIRTUAL_CALL(_exit)) {
|
||||||
GDVIRTUAL_CALL(_exit);
|
_exit();
|
||||||
_exit();
|
}
|
||||||
data.elapsed = 0.0;
|
data.elapsed = 0.0;
|
||||||
}
|
}
|
||||||
return data.status;
|
return data.status;
|
||||||
|
@ -259,9 +260,9 @@ void BTTask::abort() {
|
||||||
get_child(i)->abort();
|
get_child(i)->abort();
|
||||||
}
|
}
|
||||||
if (data.status == RUNNING) {
|
if (data.status == RUNNING) {
|
||||||
// First script, then native.
|
if (!GDVIRTUAL_CALL(_exit)) {
|
||||||
GDVIRTUAL_CALL(_exit);
|
_exit();
|
||||||
_exit();
|
}
|
||||||
}
|
}
|
||||||
data.status = FRESH;
|
data.status = FRESH;
|
||||||
data.elapsed = 0.0;
|
data.elapsed = 0.0;
|
||||||
|
|
Loading…
Reference in New Issue