Exemple #1
0
 /// <inheritdoc />
 public override MethodBase DetourTo(MethodBase replacement)
 {
     ilHook ??= new ILHook(Original, Manipulator, new ILHookConfig {
         ManualApply = true
     });
     // Reset IsApplied to force MonoMod to reapply the ILHook without removing it
     SetIsApplied(ilHook, false);
     try
     {
         ilHook.Apply();
     }
     catch (Exception e)
     {
         throw HarmonyException.Create(e, hookBody);
     }
     return(ilHook.GetCurrentTarget());
 }