Merge pull request #7723 from lonesurvivor/gdscript-range-fix
Fix parsing bug which causes range(variable) to crash the engine
This commit is contained in:
commit
530de920d4
@ -2577,7 +2577,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
|
||||
Vector<Node*> args;
|
||||
Vector<double> constants;
|
||||
|
||||
bool constant=true;
|
||||
bool constant=false;
|
||||
|
||||
for(int i=1;i<op->arguments.size();i++) {
|
||||
args.push_back(op->arguments[i]);
|
||||
@ -2585,13 +2585,12 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
|
||||
ConstantNode *c = static_cast<ConstantNode*>(op->arguments[i]);
|
||||
if (c->value.get_type()==Variant::REAL || c->value.get_type()==Variant::INT) {
|
||||
constants.push_back(c->value);
|
||||
} else {
|
||||
constant=false;
|
||||
constant=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (args.size()>0 || args.size()<4) {
|
||||
if (args.size()>0 && args.size()<4) {
|
||||
|
||||
if (constant) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user