From bcbcf0f1eae73638e8f76e5acc2b2f3267973483 Mon Sep 17 00:00:00 2001 From: Thakee Nathees Date: Fri, 6 Mar 2020 21:26:25 +0530 Subject: [PATCH] logic error in gdscript_parser.cpp for-loop-range there was a logic error in for loop range argument that check if all of the argument were constants, fixed --- modules/gdscript/gdscript_parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 0382944efdca..de7d73230d72 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3102,18 +3102,18 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { Vector args; Vector constants; - bool constant = false; + bool constant = true; for (int i = 1; i < op->arguments.size(); i++) { args.push_back(op->arguments[i]); - if (constant && op->arguments[i]->type == Node::TYPE_CONSTANT) { + if (op->arguments[i]->type == Node::TYPE_CONSTANT) { ConstantNode *c = static_cast(op->arguments[i]); if (c->value.get_type() == Variant::FLOAT || c->value.get_type() == Variant::INT) { constants.push_back(c->value); - constant = true; } } else { constant = false; + break; } }