Skip to content

Commit 2e090c2

Browse files
committed
fix[glfw]: Fix IndexOOB when requesting GLFW_KEY_LAST
Fixes C1OUS3R/Undertale#23 hopefully
1 parent 951b35c commit 2e090c2

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4903cfc8d3afd63918f59caf0a146efc2d837069
1+
349d027673855ffded0bb7471a5b662a63b438bd

jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFW.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,9 @@ public static int glfwGetKeyScancode(int key) {
11591159
}
11601160

11611161
public static int glfwGetKey(@NativeType("GLFWwindow *") long window, int key) {
1162+
// This is jank, anything asking for int 348 results in an IndexOutOfBounds because idk.
1163+
// Probably an off-by-one error. This is the 'fix'
1164+
if (key == GLFW_KEY_LAST){return GLFW_KEY_LAST;}
11621165
return keyDownBuffer.get(Math.max(0, key-31));
11631166
}
11641167

0 commit comments

Comments
 (0)