diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-10 13:08:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 13:08:01 +0100 |
commit | 95c9345b633e6b06664870fab50fc48304eed84a (patch) | |
tree | 50e0d1e8abd5e9494797f1cb9824e36189720fa4 /modules/gdscript | |
parent | 002d821e6e66f67966193c7297347b8d4f56c536 (diff) | |
parent | bcbcf0f1eae73638e8f76e5acc2b2f3267973483 (diff) |
Merge pull request #36859 from ThakeeNathees/logic-error-for-loop-range-parsing
Fix: logic error in gdscript_parser.cpp for-loop-range
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 0382944efd..de7d73230d 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<Node *> args; Vector<double> 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<ConstantNode *>(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; } } |