You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
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
(cherry picked from commit bcbcf0f1ea)
This commit is contained in:
committed by
Rémi Verschelde
parent
e590a33d45
commit
5798c8135f
@@ -3103,18 +3103,18 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
|
|||||||
Vector<Node *> args;
|
Vector<Node *> args;
|
||||||
Vector<double> constants;
|
Vector<double> constants;
|
||||||
|
|
||||||
bool constant = false;
|
bool constant = true;
|
||||||
|
|
||||||
for (int i = 1; i < op->arguments.size(); i++) {
|
for (int i = 1; i < op->arguments.size(); i++) {
|
||||||
args.push_back(op->arguments[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]);
|
ConstantNode *c = static_cast<ConstantNode *>(op->arguments[i]);
|
||||||
if (c->value.get_type() == Variant::REAL || c->value.get_type() == Variant::INT) {
|
if (c->value.get_type() == Variant::REAL || c->value.get_type() == Variant::INT) {
|
||||||
constants.push_back(c->value);
|
constants.push_back(c->value);
|
||||||
constant = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
constant = false;
|
constant = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user