mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-22 18:47:11 -04:00
fix[glfw]: Fix IndexOOB when requesting GLFW_KEY_LAST (#15)
This commit is contained in:
Binary file not shown.
@@ -1 +1 @@
|
||||
4903cfc8d3afd63918f59caf0a146efc2d837069
|
||||
349d027673855ffded0bb7471a5b662a63b438bd
|
||||
@@ -1159,6 +1159,9 @@ public class GLFW
|
||||
}
|
||||
|
||||
public static int glfwGetKey(@NativeType("GLFWwindow *") long window, int key) {
|
||||
// This is jank, anything asking for int 348 results in an IndexOutOfBounds because idk.
|
||||
// Probably an off-by-one error. This is the 'fix'
|
||||
if (key == GLFW_KEY_LAST){return GLFW_KEY_LAST;}
|
||||
return keyDownBuffer.get(Math.max(0, key-31));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user