[Bug] Random crash on Steam deck with IndexOutOfBoundsException on controller tick
Da-Boom opened this issue ยท 2 comments
Current Behaviour
during gameplay the play will crash seemingly at random with an IndexOutOfBoundsException on controller tick
Crash Report:
crash-2024-02-04_12.43.30-client.txt
Expected Behaviour
The game continues to run without crashing
Screenshots
No response
Reproduction Steps
- Use prism Launcher via flatpak on steam deck
- install the "Fabulously Optimized" modpack via modrinth - latest version (5.8.0-beta.8)
- Add the modpack as a direct launch non-steam title (using command line: "run" "--branch=stable" "--arch=x86_64" "--command=prismlauncher" "--file-forwarding" "org.prismlauncher.PrismLauncher" '--launch' 'Fabulously Optimized')
- Set Controller gyro as mouse or joystic via steam controller settings (i tried both)
- launch game in gaming mode
- play a world (i used survival, normal difficulty) and wait for crash - last time it happened i walked away from the deck for a brief moment, but its also happened while playing.
Logs
logs as uploaded above
Mod Version
1.8.1+1.20.4
Controller
issues
Bluetooth
- Yes
Operating System
Linux/SteamOS
ARM
- Yes
Additional Information
Crash Report:
crash-2024-02-04_12.43.30-client.txt
using fabulously optimized modpack via modrinth on latest steam deck beta client (v 1706914901, API SteamClient021)
Just to make sure...
- I have made sure I am using the latest version of Controlify for the latest version of Minecraft.
- I have made sure there are no other issues describing the same problem on the issue tracker.
possible cause: at src/main/java/dev/isxander/controlify/screenop/compat/vanilla/RecipeBookScreenProcessor.java on line 55 it does int index = tabs.indexOf(selectedTab)
but doesnt check if the return value is -1, when its not found, instead checks if its not 0, which passes if the value is -1. also later that index
variable is used as follows on line 57: button = tabs.get(index - 1);
possible fix:
...
/* L55 */ int index = tabs.indexOf(selectedTab);
// if(index != 0) { <- bad, passes on -1
/* L56 */ if(index > 0) { // now checks if it's not less than or equal to zero which will not pass on -1
/* L57 */ button = tabs.get(index - 1);
/* L58 */ recipeBookComponent.mouseClicked(button.getX(), button.getY(), 0);
/* L59 */ }
...
this was fixed in #234
it won't even reach that index check now