Open MaPePeR opened 10 years ago
Ok, the problem turns out a bit different, than i thought: It only occurs when there are 2 mods which hook different version of the overloaded method. Then both mods will be invoked for both method signatures. (Confirmed this with some test mods)
The reason for this is, that the ScrollsFilter
-class only patches/weaves methods that match the full signature.
so we need a way to generate a complete signature out of the method, instead of it's name. Something like method.returntype.name + method.name + for (string argument in method.arguments) { +argument.type.name } would be enough, don't you think so? Maybe we can add this through an extension method?
yes. exactly.
I think MethodReference.FullName
should work.(`MethodDefinition inherits from it)
The return type is not needed, because methods are only unique in declaringType + name + arguments.
I found several places in the code, where a method is only identified by its
DeclaringType
and itsName
.This might result in overloaded Methods not be hookable, because always the first method with matching name and type is hooked.
(confirmed this now)