边缘世界 RimWorld

边缘世界 RimWorld

吱星人-鼠族基因扩展
Error Report
I'm sharing an issue I encountered while working with this mod, which resulted in the following runtime error:

Error in static constructor of RatkinGeneExpanded.Patch: System.TypeInitializationException: The type initializer for 'RatkinGeneExpanded.Patch' threw an exception. ---> HarmonyLib.HarmonyException: Patching exception in method null ---> System.ArgumentException: Undefined target method for patch method static System.Boolean RatkinGeneExpanded.SYSPatch_ReplaceSYSDrawPrefix::ReplacePrefix(System.Boolean& __result)


This error was caused by a misconfigured Harmony patch in the SYSPatch_ReplaceSYSDrawPrefix class. The patch attribute was originally written as:

[HarmonyPatch(typeof(DrawEquipment_WeaponBackPatch))]


However, the class DrawEquipment_WeaponBackPatch does not actually exist in the codebase. The correct class name is DrawEquipment_WeaponBackPatchReplace.

To fix the issue, I updated the patch target to:

[HarmonyPatch(typeof(DrawEquipment_WeaponBackPatchReplace))]


After this change, Harmony was able to locate the target method correctly, and the patch applied as expected. The exception no longer appears during initialization, and the patch behaves as intended.

Sharing this in case others run into the same issue or need help debugging similar Undefined target method errors with Harmony.

Would this change potentially cause any other issues elsewhere in the mod?
If so, I’d appreciate it if you could take a look and confirm.
< >
正在显示第 1 - 1 条,共 1 条留言
+1!My game also had this error and kept reporting it repeatedly.I was completely at a loss as to what to do. Your sharing saved me and my colonies. Thanks a million for your sharing!
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50