Open amadare42 opened 1 year ago
@amadare42 I thought each compiled code had separate nameless assemblies. I set a debug break here, and only one ACsMod from the currently compiled mod is found (here):
return Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(ACsMod))).ToList();
No, this was in fact how it used to be. the Cs modloader has been rewritten as of the 1.1.19.x update. You can now use PatchAll() again.
Hello. Currently, Lua for Barotrauma have significant limitation - all
ACsMod
s are compiled in the same assembly. Therefore when you doHarmony.PatchAll(Assembly.GetExecutingAssembly());
, Harmony will find not only your mod, but all other mods that have definedHarmonyPatch
es. Hence same postfix, prefix, tranpiler hooks would be applied again. That will break other mods with Harmony patches.Please consider opting out of using default
Harmony.PatchAll()
statement to make your mod more compatible with other mods. You may use same helper class that I wrote https://github.com/amadare42/BarotraumaMods/blob/master/ItemFinderCountProj/CSharp/Client/HarmonyHelper.cs that allows to apply all patches in class recursively. Or came up with your own solution.Thank you.