Selaa lähdekoodia

range() with non-numeric const argument crash fix

(cherry picked from commit 3e10392d4845d8f3aa3a271186812377023cc19f)
Thakee Nathees 5 vuotta sitten
vanhempi
commit
72aa9ce7fc
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      modules/gdscript/gdscript_parser.cpp

+ 2 - 0
modules/gdscript/gdscript_parser.cpp

@@ -3156,6 +3156,8 @@ void GDScriptParser::_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;
 								}
 							} else {
 								constant = false;