diff --git a/bt/composites/bt_parallel.cpp b/bt/composites/bt_parallel.cpp index 9c04ef6..b10fbc8 100644 --- a/bt/composites/bt_parallel.cpp +++ b/bt/composites/bt_parallel.cpp @@ -26,7 +26,7 @@ int BTParallel::_tick(double p_delta) { for (int i = 0; i < get_child_count(); i++) { int status = 0; Ref child = get_child(i); - if (!repeat && (child->get_status() == FAILURE or child->get_status() == SUCCESS)) { + if (!repeat && (child->get_status() == FAILURE || child->get_status() == SUCCESS)) { status = child->get_status(); } else { status = child->execute(p_delta); diff --git a/bt/decorators/bt_probability.cpp b/bt/decorators/bt_probability.cpp index dfad1eb..1c14758 100644 --- a/bt/decorators/bt_probability.cpp +++ b/bt/decorators/bt_probability.cpp @@ -19,7 +19,7 @@ String BTProbability::_generate_name() const { int BTProbability::_tick(double p_delta) { ERR_FAIL_COND_V_MSG(get_child_count() == 0, FAILURE, "BT decorator has no child."); - if (get_child(0)->get_status() == RUNNING or Math::randf() <= run_chance) { + if (get_child(0)->get_status() == RUNNING || Math::randf() <= run_chance) { return get_child(0)->execute(p_delta); } return FAILURE; diff --git a/bt/decorators/bt_time_limit.cpp b/bt/decorators/bt_time_limit.cpp index b2367d8..32dbc1b 100644 --- a/bt/decorators/bt_time_limit.cpp +++ b/bt/decorators/bt_time_limit.cpp @@ -20,7 +20,7 @@ String BTTimeLimit::_generate_name() const { int BTTimeLimit::_tick(double p_delta) { ERR_FAIL_COND_V_MSG(get_child_count() == 0, FAILURE, "BT decorator has no child."); int status = get_child(0)->execute(p_delta); - if (status == RUNNING and get_elapsed_time() >= time_limit) { + if (status == RUNNING && get_elapsed_time() >= time_limit) { get_child(0)->cancel(); return FAILURE; } diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 6ffc969..86f7ba1 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -182,7 +182,7 @@ void TaskTree::load_bt(const Ref &p_behavior_tree) { ERR_FAIL_COND_MSG(p_behavior_tree.is_null(), "Tried to load a null tree."); Callable on_task_changed = callable_mp(this, &TaskTree::_on_task_changed); - if (last_selected.is_valid() and last_selected->is_connected("changed", on_task_changed)) { + if (last_selected.is_valid() && last_selected->is_connected("changed", on_task_changed)) { last_selected->disconnect("changed", on_task_changed); } @@ -195,7 +195,7 @@ void TaskTree::load_bt(const Ref &p_behavior_tree) { void TaskTree::unload() { Callable on_task_changed = callable_mp(this, &TaskTree::_on_task_changed); - if (last_selected.is_valid() and last_selected->is_connected("changed", on_task_changed)) { + if (last_selected.is_valid() && last_selected->is_connected("changed", on_task_changed)) { last_selected->disconnect("changed", on_task_changed); } @@ -314,7 +314,7 @@ TaskTree::TaskTree() { TaskTree::~TaskTree() { Callable on_task_changed = callable_mp(this, &TaskTree::_on_task_changed); - if (last_selected.is_valid() and last_selected->is_connected("changed", on_task_changed)) { + if (last_selected.is_valid() && last_selected->is_connected("changed", on_task_changed)) { last_selected->disconnect("changed", on_task_changed); } } diff --git a/util/limbo_utility.cpp b/util/limbo_utility.cpp index da9f8d5..27d8c76 100644 --- a/util/limbo_utility.cpp +++ b/util/limbo_utility.cpp @@ -28,7 +28,7 @@ LimboUtility *LimboUtility::get_singleton() { String LimboUtility::decorate_var(String p_variable) const { String var = p_variable.trim_prefix("$").trim_prefix("\"").trim_suffix("\""); - if (var.find(" ") == -1 and not var.is_empty()) { + if (var.find(" ") == -1 && !var.is_empty()) { return vformat("$%s", var); } else { return vformat("$\"%s\"", var);