diff --git a/deob-ast/src/main/java/dev/openrs2/deob/ast/gl/GlRegistry.kt b/deob-ast/src/main/java/dev/openrs2/deob/ast/gl/GlRegistry.kt index a602c8ca8f..e540f2ce17 100644 --- a/deob-ast/src/main/java/dev/openrs2/deob/ast/gl/GlRegistry.kt +++ b/deob-ast/src/main/java/dev/openrs2/deob/ast/gl/GlRegistry.kt @@ -34,16 +34,18 @@ data class GlRegistry(val enums: ImmutableSetMultimap, val command val enumsBuilder = ImmutableSetMultimap.builder() val groupsBuilder = HashMultimap.create() - for (elements in root.getChildren("enums")) { - for (element in elements.getChildren("enum")) { + for (parent in root.getChildren("enums")) { + val parentGroups = (parent.getAttributeValue("group") ?: "").split(",") + + for (element in parent.getChildren("enum")) { val name = element.getAttributeValue("name") val value = parseValue(element.getAttributeValue("value")) val enum = GlEnum(name, value) enumsBuilder.put(value, enum) - val groups = element.getAttributeValue("group") ?: continue - for (group in groups.split(",")) { + val groups = (element.getAttributeValue("group") ?: "").split(",") + for (group in parentGroups union groups) { groupsBuilder.put(group, enum) } }