Closed toasterkun closed 3 years ago
Found out that my reference to NLog was the cause of the ReflectionTypeLoadException from GetTypes. Issue closed as removing that reference can also be used to solve this problem without the proposed code change.
thx :D
I'm sorry for my English. It's not my first language.
I think the method GetAllTypesThatImplementInterface in ModInit may cause some problem if there's a Mod that extends a Class defined in another assembly when that assembly is not also referenced in IRBTModUtils (reference). The problem stems from the call to GetTypes which can throw a ReflectionTypeLoadException and causes ModTek to crash (please see attached ModTek log). This problem also occurs in Clever Girl which I believe uses the exact same code.
I can confirm that if I remove one of my mod that has such derived class as described in that Stackoverflow article, both IRBTM and Clever Girl works without any problem.
Based on the reference provided above, after recompiling IRBTMod and Clever girl with the following changes, it seems to work even with such derived classes in one of the active mods. Unfortunately, I don't know how to test whether the Mech Move Modifiers feature in IRBTM (and the similar feature in Clever Girl) is still working as you intended to be with these changes.
I'm sorry if these "fixes" might not actually be the correct solution.
thx:) ModTek.log