Skip to content

Commit

Permalink
Fix for Chest UI with nocost and 1.3.2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivaylo-Lafchiev committed May 16, 2021
1 parent 0152cd0 commit 7940c11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions GameClasses/InventoryGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ internal static bool PrefixUpdateCraftingPanel(InventoryGui __instance, bool foc
if (ValheimRecycle.instance != null)
{
Player localPlayer = Player.m_localPlayer;
if (localPlayer.GetCurrentCraftingStation().gameObject.name.Contains("artisanstation"))
if (localPlayer.GetCurrentCraftingStation() && (localPlayer.GetCurrentCraftingStation().gameObject.name.Contains("cauldron") || localPlayer.GetCurrentCraftingStation().gameObject.name.Contains("artisanstation")))
{
ValheimRecycle.instance.recycleObject.SetActive(false);
ValheimRecycle.instance.recycleButton.interactable = true;
return true;
}
if (!localPlayer.GetCurrentCraftingStation() && !localPlayer.NoCostCheat())
Expand All @@ -62,19 +64,11 @@ internal static bool PrefixUpdateCraftingPanel(InventoryGui __instance, bool foc
__instance.m_tabUpgrade.gameObject.SetActive(false);
ValheimRecycle.instance.recycleObject.SetActive(false);
ValheimRecycle.instance.recycleButton.interactable = true;

}
else
{
__instance.m_tabUpgrade.gameObject.SetActive(true);
if (!localPlayer.GetCurrentCraftingStation().gameObject.name.Contains("cauldron"))
{
ValheimRecycle.instance.recycleObject.SetActive(true);
}
else
{
ValheimRecycle.instance.recycleObject.SetActive(false);
}
ValheimRecycle.instance.recycleObject.SetActive(true);
}
List<Recipe> recipes = new List<Recipe>();
localPlayer.GetAvailableRecipes(ref recipes);
Expand Down
2 changes: 1 addition & 1 deletion ValheimRecycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace ValheimRecycle
{
[BepInPlugin("org.lafchi.plugins.valheim_recycle", "Valheim Recycle", "1.3.2")]
[BepInPlugin("org.lafchi.plugins.valheim_recycle", "Valheim Recycle", "1.3.3")]
[BepInProcess("valheim.exe")]
public class ValheimRecycle : BaseUnityPlugin
{
Expand Down

0 comments on commit 7940c11

Please sign in to comment.