diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2023-09-19 20:35:45 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2023-09-19 22:26:06 +0300 |
commit | c35cb51d7432f32ed04357f0d09875bce8288b4e (patch) | |
tree | ce8982b6c34a3b090cd5b1657057ec5f1f99cc46 /modules/gdscript/gdscript_analyzer.cpp | |
parent | 571cd0eb791b37e9a8adda9f909251138170f6b7 (diff) | |
download | redot-engine-c35cb51d7432f32ed04357f0d09875bce8288b4e.tar.gz |
GDScript: Fix subscript resolution for constant non-metatypes
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 077b30a7fe..87ad6f4cea 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -4099,7 +4099,7 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri GDScriptParser::DataType base_type = p_subscript->base->get_datatype(); bool valid = false; // If the base is a metatype, use the analyzer instead. - if (p_subscript->base->is_constant && !base_type.is_meta_type) { + if (p_subscript->base->is_constant && !base_type.is_meta_type && base_type.kind != GDScriptParser::DataType::CLASS) { // Just try to get it. Variant value = p_subscript->base->reduced_value.get_named(p_subscript->attribute->name, valid); if (valid) { |