From 722be9aaef2746033f3a46c9a6349be7545918f9 Mon Sep 17 00:00:00 2001 From: George Marques Date: Mon, 24 Aug 2020 09:15:33 -0300 Subject: GDScript: Don't fail to load constants if they're not a literal It's still okay as long as it's a constant value. This should already been validated by the analyzer. --- modules/gdscript/gdscript_compiler.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index e34d87f5cc..1631fa11bb 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -2696,11 +2696,7 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar const GDScriptParser::ConstantNode *constant = member.constant; StringName name = constant->identifier->name; - ERR_CONTINUE(constant->initializer->type != GDScriptParser::Node::LITERAL); - - const GDScriptParser::LiteralNode *literal = static_cast(constant->initializer); - - p_script->constants.insert(name, literal->value); + p_script->constants.insert(name, constant->initializer->reduced_value); #ifdef TOOLS_ENABLED p_script->member_lines[name] = constant->start_line; -- cgit v1.2.3