Skip to content
This repository was archived by the owner on Oct 31, 2022. It is now read-only.

Commit 7574047

Browse files
committed
Version 1.0.1
* Fixed AmbiguousMatchException in newer versions of Harmony
1 parent 8a0322a commit 7574047

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Consensus/Consensus.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
55
<LangVersion>9</LangVersion>
66
<Authors>Fasguy</Authors>
7-
<Version>1.0.0</Version>
7+
<Version>1.0.1</Version>
88
<AssemblyVersion>$(Version)</AssemblyVersion>
99
<FileVersion>$(Version)</FileVersion>
1010
<Copyright>Fasguy</Copyright>

Consensus/ConsensusPatcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static class ConsensusPatcher
1414

1515
private static readonly MethodInfo _patchClassTranspiler = AccessTools.Method(typeof(ConsensusPatcher), nameof(PatchClassTranspiler));
1616
private static readonly MethodInfo _replaceIEnumeratorPatch = AccessTools.Method(typeof(ConsensusPatcher), nameof(ReplaceIEnumeratorPatch));
17-
private static readonly MethodInfo _merge = AccessTools.Method(typeof(HarmonyMethod), nameof(HarmonyMethod.Merge));
17+
private static readonly MethodInfo _merge = AccessTools.Method(typeof(HarmonyMethod), nameof(HarmonyMethod.Merge), new[] { typeof(List<HarmonyMethod>) });
1818

1919
public static void Patch(Harmony instance)
2020
{
@@ -39,9 +39,9 @@ private static HarmonyMethod ReplaceIEnumeratorPatch(HarmonyMethod harmonyMethod
3939
ConsensusAttribute consensusAttribute = type.GetCustomAttributes().FirstOrDefault(attr => attr is ConsensusAttribute) as ConsensusAttribute;
4040

4141
if (consensusAttribute == null) return harmonyMethod;
42-
42+
4343
MethodInfo methodInfo = AccessTools.Method(harmonyMethod.declaringType, harmonyMethod.methodName);
44-
44+
4545
harmonyMethod.declaringType = GetInternalType(methodInfo);
4646
harmonyMethod.methodName = nameof(IEnumerator.MoveNext);
4747
if (consensusAttribute.ToPatch == PatchEnumerator.Current)

0 commit comments

Comments
 (0)