When prefetch fails, don't print error if variable is on blackboard

This commit is contained in:
Serhii Snitsaruk 2024-03-11 22:12:44 +01:00
parent b09006a11b
commit e2edb083ff
1 changed files with 4 additions and 1 deletions

View File

@ -284,7 +284,10 @@ inline void bb_add_var_dup_with_prefetch(const Ref<Blackboard> &p_blackboard, co
if (n != nullptr) {
var.set_value(n);
} else {
ERR_PRINT(vformat("BlackboardPlan: Prefetch failed for variable $%s with value: %s", p_name, p_var.get_value()));
// Print error only if the variable is not present (it can be initialized by the user or in the parent scope).
if (!p_blackboard->has_var(p_name)) {
ERR_PRINT(vformat("BlackboardPlan: Prefetch failed for variable $%s with value: %s", p_name, p_var.get_value()));
}
}
p_blackboard->add_var(p_name, var);
} else {