Merge pull request #36859 from ThakeeNathees/logic-error-for-loop-range-parsing

Fix: logic error in gdscript_parser.cpp for-loop-range
This commit is contained in:
Rémi Verschelde 2020-03-10 13:08:01 +01:00 committed by GitHub
commit 95c9345b63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}