DLL: Output enum return type method bodies correctly
This commit is contained in:
@@ -357,8 +357,8 @@ namespace Il2CppInspector.Outputs
|
|||||||
if (mMethod.ReturnType.FullName == "System.Void")
|
if (mMethod.ReturnType.FullName == "System.Void")
|
||||||
inst.Add(OpCodes.Ret.ToInstruction());
|
inst.Add(OpCodes.Ret.ToInstruction());
|
||||||
|
|
||||||
// Return default for value type
|
// Return default for value type or enum
|
||||||
else if (mMethod.ReturnType.IsValueType) {
|
else if (mMethod.ReturnType.IsValueType || ((MethodInfo) method).ReturnType.IsEnum) {
|
||||||
var result = new Local(mMethod.ReturnType);
|
var result = new Local(mMethod.ReturnType);
|
||||||
mMethod.Body.Variables.Add(result);
|
mMethod.Body.Variables.Add(result);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user