You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MethodPatcher uses the FullName to distinguish __state variables of individual patchers. This leads to patches in classes with the identical name (but defined in different assemblies) sharing a same __state, causing incompatibilites.
Mapping by AssemblyQualifiedName will fix this.
To Reproduce
Create a simple class with a Prefix and Postfix method, which each take a __state. Assign __state some class V { public int i = 0; } in Prefix. In Postfix increment and dump V.i.
Include the exact same class in another assembly, with the same name and namespace.
Then apply both patches to a method and run it.
Now, observe V.i being output once as 1 and once as 2.
Expected behavior
Both patches should dump 1, i.e. not be shared.
Runtime environment:
Harmony version: master
The text was updated successfully, but these errors were encountered:
Describe the bug
MethodPatcher uses the FullName to distinguish __state variables of individual patchers. This leads to patches in classes with the identical name (but defined in different assemblies) sharing a same __state, causing incompatibilites.
Mapping by AssemblyQualifiedName will fix this.
To Reproduce
Create a simple class with a Prefix and Postfix method, which each take a __state. Assign __state some class V { public int i = 0; } in Prefix. In Postfix increment and dump V.i.
Include the exact same class in another assembly, with the same name and namespace.
Then apply both patches to a method and run it.
Now, observe V.i being output once as 1 and once as 2.
Expected behavior
Both patches should dump 1, i.e. not be shared.
Runtime environment:
The text was updated successfully, but these errors were encountered: