Faeryn / OutwardBetterInventory

GNU General Public License v3.0
0 stars 1 forks source link

Salvage button broken by "failed recipes don't consume [...]" mods #1

Closed alaestor closed 2 years ago

alaestor commented 2 years ago

Both exp111's FailedRecipesDontConsumeItems and UrbanVibes' Failed Recipes do not consume Ingredients cause "Salvage" to not function.

Sample of relevant log output:

[Debug  :BetterInventory] Trying to salvage item: 2130130
NullReferenceException: Object reference not set to an instance of an object
  at ItemPriceHelper.ItemPriceHelper.UpdateValueDisplay (ItemDisplay itemDisplay, UnityEngine.GameObject valueHolder, UnityEngine.UI.Text valueLabel) [0x0019c] in <2b9f332b2d6649c5a9a7558fe7bcb39a>:0 
  at ItemPriceHelper.ItemPriceHelper+ItemDisplay_Hooks.Postfix1 (ItemDisplay __instance, UnityEngine.GameObject ___m_valueHolder, UnityEngine.UI.Text ___m_lblValue) [0x0001c] in <2b9f332b2d6649c5a9a7558fe7bcb39a>:0 
  at (wrapper dynamic-method) ItemDisplay.DMD<ItemDisplay::SetReferencedItem>(ItemDisplay,Item)
  at IngredientSelector.Set (RecipeIngredient _recipeIngredient, CompatibleIngredient _bestCandidate) [0x000d4] in <953f7668418441b882ecff3de0df8b11>:0 
  at (wrapper dynamic-method) CraftingMenu.DMD<CraftingMenu::IngredientSelectorHasChanged>(CraftingMenu,int,int)
  at BetterInventory.ContextMenu.SalvageAction.TryCraft (CraftingMenu craftingMenu, System.Int32 itemID) [0x0002d] in <3d7e6f79513d4af3ab007b8ce22eb8ed>:0 
  at BetterInventory.ContextMenu.SalvageAction.ExecuteAction (ContextMenuOptions contextMenu, ItemDisplay itemDisplay, Item item, System.Boolean isCurrency) [0x00017] in <3d7e6f79513d4af3ab007b8ce22eb8ed>:0 
  at BetterInventory.ContextMenu.ItemContextMenuAction.ExecuteAction (ContextMenuOptions contextMenu) [0x000a7] in <3d7e6f79513d4af3ab007b8ce22eb8ed>:0 
  at BetterInventory.Patches.ContextMenuOptionsPatchHelper.ActionHasBeenPressed_Prefix (ContextMenuOptions __instance, System.Int32 _actionID) [0x00028] in <3d7e6f79513d4af3ab007b8ce22eb8ed>:0 
  at BetterInventory.Patches.ItemDisplayOptionPanelPatches.ItemDisplayOptionPanel_ActionHasBeenPressed_Prefix (ItemDisplayOptionPanel __instance, System.Int32 _actionID) [0x00001] in <3d7e6f79513d4af3ab007b8ce22eb8ed>:0 
  at (wrapper dynamic-method) ItemDisplayOptionPanel.DMD<ItemDisplayOptionPanel::ActionHasBeenPressed>(ItemDisplayOptionPanel,int)
  at ContextMenuOptions.OnActionPressed (System.Int32 _id) [0x00000] in <953f7668418441b882ecff3de0df8b11>:0 
  at ContextMenuOptions+<>c__DisplayClass2_0.<ShowOptions>b__0 () [0x00000] in <953f7668418441b882ecff3de0df8b11>:0 
  at UnityEngine.Events.InvokableCall.Invoke () [0x00010] in <ad199b1c67244da3a5ed230e5d202f21>:0 
[...]
Faeryn commented 2 years ago

NullReferenceException: Object reference not set to an instance of an object at ItemPriceHelper.ItemPriceHelper.UpdateValueDisplay (ItemDisplay itemDisplay, UnityEngine.GameObject valueHolder, UnityEngine.UI.Text valueLabel) [0x0019c] in <2b9f332b2d6649c5a9a7558fe7bcb39a>:0

The error is in ItemPriceHelper. AFAIK that mod is not updated to Definitive Edition. Can you please try without the mod? If you don't want to, I'll look into this next weekend.

alaestor commented 2 years ago

Obviously I should have read my own report a bit more closely :l Good catch, thank you! Yes; removing ItemPriceHelper solves the problem. I must have also messed up my testing because I could have sworn that removing the "failed recipes" mod also fixed it, but when trying to replicate that now, it appears to not be the case. My apologies.

Faeryn commented 2 years ago

No problem! Have fun!