From c8bfe640c80a1ff263dfcc72fe700a972c6157fc Mon Sep 17 00:00:00 2001 From: Pontus Ullgren Date: Wed, 30 Oct 2024 20:31:25 +0100 Subject: [PATCH] Updated CraftFromContainers for The Bog Witch release Method signature change in Player.HaveRequirementItems --- CraftFromContainers/BepInExPlugin.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 CraftFromContainers/BepInExPlugin.cs diff --git a/CraftFromContainers/BepInExPlugin.cs b/CraftFromContainers/BepInExPlugin.cs old mode 100644 new mode 100755 index 9c75165..43d3b89 --- a/CraftFromContainers/BepInExPlugin.cs +++ b/CraftFromContainers/BepInExPlugin.cs @@ -671,7 +671,7 @@ static void Postfix(InventoryGui __instance, List ___m_recipeList) - [HarmonyPatch(typeof(Player), "HaveRequirementItems", new Type[] { typeof(Recipe), typeof(bool), typeof(int) })] + [HarmonyPatch(typeof(Player), "HaveRequirementItems", new Type[] { typeof(Recipe), typeof(bool), typeof(int), typeof(int) })] static class HaveRequirementItems_Patch { static void Postfix(Player __instance, ref bool __result, Recipe piece, bool discover, int qualityLevel, HashSet ___m_knownMaterial) @@ -687,13 +687,13 @@ static void Postfix(Player __instance, ref bool __result, Recipe piece, bool dis { if (requirement.m_resItem) { - int amount = requirement.GetAmount(qualityLevel); + int resAmount = requirement.GetAmount(qualityLevel); int invAmount = __instance.GetInventory().CountItems(requirement.m_resItem.m_itemData.m_shared.m_name); - if(invAmount < amount) + if(invAmount < resAmount) { foreach(Container c in nearbyContainers) invAmount += c.GetInventory().CountItems(requirement.m_resItem.m_itemData.m_shared.m_name) - leaveMod; - if (invAmount < amount) + if (invAmount < resAmount) return; } }