diff options
author | Chaosus <chaosus89@gmail.com> | 2024-08-15 10:29:19 +0300 |
---|---|---|
committer | Chaosus <chaosus89@gmail.com> | 2024-08-15 10:29:19 +0300 |
commit | 3272f0052589d430e7c7fa26e172a84f8b0a2c39 (patch) | |
tree | f826b56d026b7154ea4631b7ca0e2e2460eb25ce | |
parent | 33c30b9e63a58b860cb2f36957c5e25cee34a627 (diff) | |
download | redot-engine-3272f0052589d430e7c7fa26e172a84f8b0a2c39.tar.gz |
Fix middle expression of `for` loop to accept not only operators
-rw-r--r-- | servers/rendering/shader_language.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 0235d72cfa..4c7498c2c2 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -8061,7 +8061,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun if (!expr) { return ERR_PARSE_ERROR; } - is_condition = expr->type == Node::NODE_TYPE_OPERATOR && expr->get_datatype() == TYPE_BOOL; + is_condition = expr->get_datatype() == TYPE_BOOL; if (expr->type == Node::NODE_TYPE_OPERATOR) { OperatorNode *op = static_cast<OperatorNode *>(expr); @@ -8077,7 +8077,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun if (p_block->block_type == BlockNode::BLOCK_TYPE_FOR_CONDITION) { if (tk.type == TK_COMMA) { if (!is_condition) { - _set_error(RTR("The middle expression is expected to be a boolean operator.")); + _set_error(RTR("The middle expression is expected to have a boolean data type.")); return ERR_PARSE_ERROR; } continue; @@ -8106,7 +8106,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun return ERR_PARSE_ERROR; } if (p_block->block_type == BlockNode::BLOCK_TYPE_FOR_CONDITION && !is_condition) { - _set_error(RTR("The middle expression is expected to be a boolean operator.")); + _set_error(RTR("The middle expression is expected to have a boolean data type.")); return ERR_PARSE_ERROR; } } |