xoxfaby / BetterUI

Risk of Rain 2 mod BetterUI
Other
62 stars 34 forks source link

Item sorting craps itself when it comes across a new itemtier. #131

Closed Bubbet closed 1 year ago

Bubbet commented 2 years ago

[Error : Unity Log] KeyNotFoundException: The given key was not present in the dictionary. Stack trace: System.Collections.Generic.Dictionary2[TKey,TValue].get_Item (TKey key) (at <44afb4564e9347cf99a1865351ea8f4a>:IL_001E) BetterUI.ItemSorting+<>c.<.cctor>b33_14 (System.Linq.IOrderedEnumerable1[TElement] order, RoR2.Inventory inventory, RoR2.ItemIndex item) (at C:/Users/Bubbet/Desktop/Dev/Programming/C#/BetterUI/ModComponents/ItemSorting.cs:90) BetterUI.ItemSorting+<>c__DisplayClass29_01[T].b0 (RoR2.ItemIndex item) (at C:/Users/Bubbet/Desktop/Dev/Programming/C#/BetterUI/ModComponents/ItemSorting.cs:165) System.Linq.EnumerableSorter2[TElement,TKey].ComputeKeys (TElement[] elements, System.Int32 count) (at <55b3683038794c198a24e8a1362bfc61>:IL_0010) System.Linq.EnumerableSorter1[TElement].Sort (TElement[] elements, System.Int32 count) (at <55b3683038794c198a24e8a1362bfc61>:IL_0000) System.Linq.OrderedEnumerable1+<GetEnumerator>d__1[TElement].MoveNext () (at <55b3683038794c198a24e8a1362bfc61>:IL_004B) System.Linq.Buffer1[TElement]..ctor (System.Collections.Generic.IEnumerable1[T] source) (at <55b3683038794c198a24e8a1362bfc61>:IL_0072) System.Linq.OrderedEnumerable1+d__1[TElement].MoveNext () (at <55b3683038794c198a24e8a1362bfc61>:IL_0021) System.Collections.Generic.List1[T]..ctor (System.Collections.Generic.IEnumerable1[T] collection) (at <44afb4564e9347cf99a1865351ea8f4a>:IL_0077) System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) (at <55b3683038794c198a24e8a1362bfc61>:IL_000E) BetterUI.ItemSorting.sortItems (System.Collections.Generic.List1[T] itemList, RoR2.Inventory inventory, System.String sortOrder) (at C:/Users/Bubbet/Desktop/Dev/Programming/C#/BetterUI/ModComponents/ItemSorting.cs:322) BetterUI.ItemSorting.ItemInventoryDisplay_OnInventoryChanged (System.Action1[T] orig, RoR2.UI.ItemInventoryDisplay self) (at C:/Users/Bubbet/Desktop/Dev/Programming/C#/BetterUI/ModComponents/ItemSorting.cs:331) DMD<>?-366640384.Hook<RoR2.UI.ItemInventoryDisplay::OnInventoryChanged>?1393550848 (RoR2.UI.ItemInventoryDisplay ) (at <fd9da875d479423fac929315c26dfaf8>:IL_000A) RoR2.Inventory.HandleInventoryChanged () (at <7a5120bd69d843a8b8e90b8cce404663>:IL_000A) RoR2.Inventory.GiveItem (RoR2.ItemIndex itemIndex, System.Int32 count) (at <7a5120bd69d843a8b8e90b8cce404663>:IL_0080) RoR2.ItemDef.AttemptGrant (RoR2.PickupDef+GrantContext& context) (at <7a5120bd69d843a8b8e90b8cce404663>:IL_001B) RoR2.GenericPickupController.AttemptGrant (RoR2.CharacterBody body) (at <7a5120bd69d843a8b8e90b8cce404663>:IL_0070) RoR2.GenericPickupController.OnInteractionBegin (RoR2.Interactor activator) (at <7a5120bd69d843a8b8e90b8cce404663>:IL_0007) RoR2.Interactor.PerformInteraction (UnityEngine.GameObject interactableObject) (at <7a5120bd69d843a8b8e90b8cce404663>:IL_0041) RoR2.Interactor.AttemptInteraction (UnityEngine.GameObject interactableObject) (at <7a5120bd69d843a8b8e90b8cce404663>:IL_0007) RoR2.InteractionDriver.FixedUpdate () (at <7a5120bd69d843a8b8e90b8cce404663>:IL_00A0)

Bubbet commented 2 years ago

I've had to publicize your dll to add my tier to the tierMap, which seems to have fixed the error.