You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Add joystick button index boundary check. Increase max. button number to 128 (max. buttons supported by DirectInput).
(cherry picked from commit 61ea8f8337)
This commit is contained in:
@@ -775,7 +775,8 @@ InputDefault::InputDefault() {
|
||||
void InputDefault::joy_button(int p_device, int p_button, bool p_pressed) {
|
||||
_THREAD_SAFE_METHOD_;
|
||||
Joypad &joy = joy_names[p_device];
|
||||
//printf("got button %i, mapping is %i\n", p_button, joy.mapping);
|
||||
ERR_FAIL_INDEX(p_button, JOY_BUTTON_MAX);
|
||||
|
||||
if (joy.last_buttons[p_button] == p_pressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user