Fix currentSelectGameObject null check (dont use ?.); block swapping components on an equipped gun with each other in raid

This commit is contained in:
Tyfon
2024-06-24 16:19:49 -07:00
parent 493dec9c3e
commit 34b1754ba2
2 changed files with 13 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ namespace UIFixes
{
// Need an item context to operate on, and ignore these keypresses if there's a focused textbox somewhere
ItemContextAbstractClass itemContext = __instance.R().ItemContext;
if (itemContext == null || EventSystem.current?.currentSelectedGameObject?.GetComponent<TMP_InputField>() != null)
if (itemContext == null || EventSystem.current?.currentSelectedGameObject != null && EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != null)
{
return;
}