diff --git a/Mirror/Weaver/Resolvers.cs b/Mirror/Weaver/Resolvers.cs index dca29d48d..f1d0ed098 100644 --- a/Mirror/Weaver/Resolvers.cs +++ b/Mirror/Weaver/Resolvers.cs @@ -58,26 +58,6 @@ public static MethodReference ResolveMethodInParents(TypeReference tr, AssemblyD return ResolveMethodInParents(tr.Resolve().BaseType, scriptDef, name); } - public static MethodReference ResolveMethodWithArg(TypeReference tr, AssemblyDefinition scriptDef, string name, TypeReference argType) - { - foreach (MethodDefinition methodRef in tr.Resolve().Methods) - { - if (methodRef.Name == name) - { - if (methodRef.Parameters.Count == 1) - { - if (methodRef.Parameters[0].ParameterType.FullName == argType.FullName) - { - return scriptDef.MainModule.ImportReference(methodRef); - } - } - } - } - Log.Error("ResolveMethodWithArg failed " + tr.Name + "::" + name + " " + argType); - Weaver.fail = true; - return null; - } - // System.Byte[] arguments need a version with a string public static MethodReference ResolveMethodWithArg(TypeReference tr, AssemblyDefinition scriptDef, string name, string argTypeFullName) { @@ -98,5 +78,11 @@ public static MethodReference ResolveMethodWithArg(TypeReference tr, AssemblyDef Weaver.fail = true; return null; } + + // reuse ResolveMethodWithArg string version + public static MethodReference ResolveMethodWithArg(TypeReference tr, AssemblyDefinition scriptDef, string name, TypeReference argType) + { + return ResolveMethodWithArg(tr, scriptDef, name, argType.FullName); + } } } \ No newline at end of file