Skip to content

Commit bb3479d

Browse files
committed
Fix hook result applying incorrectly
1 parent 4f22807 commit bb3479d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ModFramework/Emitters/HookEmitter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ static TypeDefinition CreateHookEventArgs(TypeDefinition hookType, MethodDefinit
8585
FieldDefinition resultField = new(ContinueExecutionName, FieldAttributes.Public, resultType);
8686

8787
// if the method has a return type, add a field for it
88-
var hasReturnValue = hookDefinition.ReturnType != hookDefinition.Module.TypeSystem.Void;
88+
// n.b. this may happen before/after relinking so two Void types may not be equal thus FullName is used
89+
var hasReturnValue = hookDefinition.ReturnType.FullName != hookDefinition.Module.TypeSystem.Void.FullName;
8990
if (hasReturnValue)
9091
{
9192
FieldDefinition returnField = new(HookReturnValueName, FieldAttributes.Public, hookDefinition.ReturnType);

0 commit comments

Comments
 (0)