summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_analyzer.cpp
diff options
context:
space:
mode:
authorrune-scape <allie.smith.epic@gmail.com>2022-12-16 22:46:00 -0500
committerrune-scape <allie.smith.epic@gmail.com>2022-12-16 22:48:25 -0500
commit213c94b42fbb534bd33c9af144ecc3ecf93a2720 (patch)
tree1386d3178cbb185d2a3d1ddd9176269772468e35 /modules/gdscript/gdscript_analyzer.cpp
parentf18f2740da9cce7383c2aa41fe8d081d56c8b6cf (diff)
Fix enum value regression
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 30ac1f29b1..a443556fd5 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -996,7 +996,9 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class,
check_class_member_name_conflict(p_class, member.enum_value.identifier->name, member.enum_value.parent_enum);
if (member.enum_value.index > 0) {
- member.enum_value.value = member.enum_value.parent_enum->values[member.enum_value.index - 1].value + 1;
+ const GDScriptParser::EnumNode::Value &prev_value = member.enum_value.parent_enum->values[member.enum_value.index - 1];
+ resolve_class_member(p_class, prev_value.identifier->name, member.enum_value.identifier);
+ member.enum_value.value = prev_value.value + 1;
} else {
member.enum_value.value = 0;
}