Skip to content

ReturnFlow Enum

Specifies how the return value affects control flow.

C#
public enum ReturnFlow

WARNING: Modifying the control flow of a method in a hook should NOT be done if you are copy pasting logic from the original method. This will destroy compatibility with ILHooks applied to the target method. In such a case, ALWAYS use an ILHookDetour to modify the CIL instructions of the method directly.

To learn more about ILHooking, see https://monodetour.github.io/ilhooking/introduction/

Signifies that this return value doesn’t affect control flow.

C#
None = 0

Skips the original method body, but doesn’t skip prefixes and postfixes written to it.
This is essentially the same as prefix return false in HarmonyX.

C#
SkipOriginal = 1

WARNING: Modifying the control flow of a method in a hook should NOT be done if you are copy pasting logic from the original method. This will destroy compatibility with ILHooks applied to the target method. In such a case, ALWAYS use an ILHookDetour to modify the CIL instructions of the method directly.

To learn more about ILHooking, see https://monodetour.github.io/ilhooking/introduction/

Returns immediately and doesn’t run any hooks written to the method.

C#
HardReturn = 2

WARNING: Modifying the control flow of a method in a hook should NOT be done if you are copy pasting logic from the original method. This will destroy compatibility with ILHooks applied to the target method. In such a case, ALWAYS use an ILHookDetour to modify the CIL instructions of the method directly.

To learn more about ILHooking, see https://monodetour.github.io/ilhooking/introduction/