Merge pull request #95 from limbonaut/decorator-default-tick

BTDecorator: Add default `_tick` implementation
This commit is contained in:
Serhii Snitsaruk 2024-04-30 13:14:02 +02:00 committed by GitHub
commit 0e843d3193
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -18,3 +18,8 @@ PackedStringArray BTDecorator::get_configuration_warnings() {
}
return warnings;
}
BT::Status BTDecorator::_tick(double p_delta) {
ERR_FAIL_COND_V_MSG(get_child_count() == 0, FAILURE, "BT decorator doesn't have a child.");
return get_child(0)->execute(p_delta);
}

View File

@ -17,6 +17,9 @@
class BTDecorator : public BTTask {
GDCLASS(BTDecorator, BTTask)
protected:
virtual Status _tick(double p_delta) override;
public:
virtual PackedStringArray get_configuration_warnings() override;
};