Skip to content

Commit 9af44d5

Browse files
committed
Fix 106.1 support
1 parent 70164e0 commit 9af44d5

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

LibCpp2IL/Metadata/Il2CppMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public static Il2CppMetadata ReadFrom(byte[] bytes, UnityVersion unityVersion)
151151
// - changes Il2CppGenericContainer type_argc int32 => uint16, is_method int32 => uint8
152152
//6.6.0a6 => 106.1
153153
// - adds 2 new fields to Il2CppMetadataRegistration
154-
// - removes the first value of MetadataUsageType
154+
// - removes the second value of MetadataUsageType
155155
if(unityVersion.GreaterThanOrEquals(6000, 6, 0, UnityVersionType.Alpha, 6))
156156
actualVersion = 106.1f;
157157
else

LibCpp2IL/MetadataUsage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ public override string ToString()
158158
{
159159
var encodedType = encoded & 0xE000_0000;
160160
var type = (MetadataUsageType)(encodedType >> 29);
161-
if (context.Metadata.MetadataVersion > 106.1f)
162-
type += 1; //TypeInfo removed in v106.1
161+
if (context.Metadata.MetadataVersion > 106.1f && type > MetadataUsageType.TypeInfo)
162+
type += 1; //Type removed in v106.1
163163

164164
if (type <= MetadataUsageType.MethodRef && type >= MetadataUsageType.TypeInfo)
165165
{

LibCpp2IL/MetadataUsageType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
public enum MetadataUsageType : uint
44
{
5-
TypeInfo = 1, //REMOVED in v106.1
6-
Type = 2,
5+
TypeInfo = 1,
6+
Type = 2, //REMOVED in v106.1
77
MethodDef = 3,
88
FieldInfo = 4,
99
StringLiteral = 5,

0 commit comments

Comments
 (0)