Closed 0x1d7 closed 1 month ago
No exceptions, mod loads and shows as enabled with only a single method patched. In this example, the method being patched per the log is void BattleTech.SimGameState::ResolveCompleteContract()
.
[HarmonyPatch(typeof(SimGameState), "SaveSerializationComplete")]
[HarmonyPatch(typeof(SaveGameStructure), "NotifyRefresh")]
[HarmonyPatch(typeof(SaveGameStructure), "NotifyLoadCcomplete")]
[HarmonyPatch(typeof(SimGameState), "OnHeadAttachedStateCompleteListener")]
[HarmonyPatch(typeof(TurnDirector), "StartFirstRound")]
[HarmonyPatch(typeof(TurnDirector), "BeginNewRound")]
[HarmonyPatch(typeof(SimGameState), "ResolveCompleteContract")]
static internal class GcPostSaveSerialization
I'll ask/search on the discord. Thanks!
I don't see any prefix or postfix annotation, did you just not include it here or forgot to add it altogether?
Ultimately I was able to resolve this with the help of the BepInEx discord. I needed to move my decorations to my method and then instead of calling Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(),...
, I needed to specify my type Harmony.CreateAndPatchAll(typeof(GcPostSaveSerialization)...
I attempted to decorate a single function with multiple patches unsuccessfully. Only one of the two decorations took effect per the battletech_log file. Is this feature not functional in the version of Harmony in use or is something else needed beyond the above provided example in HarmonyX?
While not critical, it would simplify my code.