public void Unpatch(MethodInfo patch) { var obj = locker; lock (obj) { foreach (var methodBase in originals) { var patchInfo = HarmonySharedState.GetPatchInfo(methodBase) ?? new PatchInfo(); PatchFunctions.RemovePatch(patchInfo, patch); PatchFunctions.UpdateWrapper(methodBase, patchInfo, instance.Id); HarmonySharedState.UpdatePatchInfo(methodBase, patchInfo); } } }
public void Unpatch(MethodInfo patch) { lock (locker) { foreach (var original in originals) { var patchInfo = HarmonySharedState.GetPatchInfo(original); if (patchInfo == null) { patchInfo = new PatchInfo(); } PatchFunctions.RemovePatch(patchInfo, patch); PatchHandler.Get(original).Apply(); } } }
public void Unpatch(MethodInfo patch) { lock (locker) { foreach (var original in originals) { var patchInfo = HarmonySharedState.GetPatchInfo(original); if (patchInfo == null) { patchInfo = new PatchInfo(); } PatchFunctions.RemovePatch(patchInfo, patch); PatchFunctions.UpdateWrapper(original, patchInfo, instance.Id); HarmonySharedState.UpdatePatchInfo(original, patchInfo); } } }