Mantas-2155X / MakerSearch

GNU General Public License v3.0
15 stars 4 forks source link

Compatibility Bug with MoreAccessories #1

Closed OrangeSpork closed 4 years ago

OrangeSpork commented 4 years ago

Trying to click into an accessory slot added by MoreAccessories throws the following stack trace. The item selection UI updates to the right slot but the list selection never updates so the list shows a different slot selected than the item property. Most operations work, but some things get weird. MaterialEditor isn't accessible notably.

Search box still functions, so I think just trapping and eating the error fixes the issue?

[Error : Unity Log] IndexOutOfRangeException: Index was outside the bounds of the array. Stack trace: HS2_MakerSearch.Hooks.CvsA_Slot_ChangeMenuFunc_ResetSearch (CharaCustom.CvsA_Slot instance) (at :0) (wrapper dynamic-method) CharaCustom.CvsA_Slot.DMD(CharaCustom.CvsA_Slot) MoreAccessoriesAI.MoreAccessories+<>c__DisplayClass47_0.b0 () (at :0) UnityEngine.Events.InvokableCall.Invoke () (at :0) UnityEngine.Events.UnityEvent.Invoke () (at :0) UnityEngine.UI.Button.Press () (at :0) UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at :0) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at :0) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at :0) UnityEngine.EventSystems.EventSystem:Update()

Mantas-2155X commented 4 years ago

Hello, thanks for reporting the issue.

I've went ahead and dug into it, seems like MoreAccessories does not update CvsA_Slot.nowAcs for the new added accessories and my patch fails at retreiving the selected accessory type because the array size is still 20.

I'll message Joan about this and start looking for an alternative way of doing what my method is doing.

Mantas-2155X commented 4 years ago

Fixed with 70191e0 (releasing update late today) Seems like changing the patch to look at the toggle is easier and faster.

Joan has been notified about the issue.