From 0d7ee4de6827e9b3ae2a90d7615ef267dd8abd4f Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Wed, 21 Aug 2024 10:57:45 -0700 Subject: [PATCH] Check __runOriginal in ExecutePossibleActions patch, compat fix for MergeConsumables --- Patches/FixTraderControllerSimulateFalsePatch.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Patches/FixTraderControllerSimulateFalsePatch.cs b/Patches/FixTraderControllerSimulateFalsePatch.cs index 0a68ee6..df3b855 100644 --- a/Patches/FixTraderControllerSimulateFalsePatch.cs +++ b/Patches/FixTraderControllerSimulateFalsePatch.cs @@ -16,8 +16,20 @@ public class FixTraderControllerSimulateFalsePatch : ModulePatch // Recreating this function to add the comment section, so calling this with simulate = false doesn't break everything [PatchPrefix] [HarmonyPriority(Priority.Last)] - public static bool Prefix(TraderControllerClass __instance, ItemContextAbstractClass itemContext, Item targetItem, bool partialTransferOnly, bool simulate, ref ItemOperation __result) + public static bool Prefix( + TraderControllerClass __instance, + ItemContextAbstractClass itemContext, + Item targetItem, + bool partialTransferOnly, + bool simulate, + ref ItemOperation __result, + bool __runOriginal) { + if (!__runOriginal) + { + return __runOriginal; + } + TargetItemOperation opStruct; opStruct.targetItem = targetItem; opStruct.traderControllerClass = __instance;