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);
|
||||
}
|
||||
|
||||
_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;
|
||||
|
|
Loading…
Reference in New Issue