-
Notifications
You must be signed in to change notification settings - Fork 331
FIX: IndexOutOfRangeException when enabling InputActionMap. (ISXB-1767) #2296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 8 commits
529b2d2
04fa062
6a11944
d4b0ba4
5ac1292
f939171
4c9cec5
3ebbcd6
870b1e9
96dbc19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1153,6 +1153,13 @@ private void EnableControls(int mapIndex, int controlStartIndex, int numControls | |
| if (IsControlEnabled(controlIndex)) | ||
| continue; | ||
|
|
||
| // We might end up here if an action map is enabled from e.g. an event processing callback such as | ||
| // InputAction.cancel event handler (ISXB-1766). In this case we must skip controls associated with | ||
ekcoh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // a device that is not connected to the system (Have deviceIndex < 0). We check this here to not | ||
| // cause side effects if aborting later in the call-chain. | ||
| if (!controls[controlIndex].device.added) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could a similar thing happen if a device were disabled?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought so which is why I extended the test to disable, enable, disable, enable but this seems to be fine. I have to admit why this is not clear and would also feel better by doing this symmetric. Should we explore making it symmetric or what do you think? |
||
| continue; | ||
|
|
||
| var bindingIndex = controlIndexToBindingIndex[controlIndex]; | ||
| var mapControlAndBindingIndex = ToCombinedMapAndControlAndBindingIndex(mapIndex, controlIndex, bindingIndex); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.