1
0
forked from Clones/Controlify

Fix GamepadController failing when SDL mappings are used

This commit is contained in:
isxander
2023-11-22 18:33:37 +00:00
parent b65981ea57
commit 09b91cfab8

View File

@ -31,8 +31,6 @@ public class GamepadController extends AbstractController<GamepadState, GamepadC
public GamepadController(int joystickId, ControllerHIDService.ControllerHIDInfo hidInfo) { public GamepadController(int joystickId, ControllerHIDService.ControllerHIDInfo hidInfo) {
super(joystickId, hidInfo); super(joystickId, hidInfo);
if (!GLFW.glfwJoystickIsGamepad(joystickId))
throw new IllegalArgumentException("Joystick " + joystickId + " is not a gamepad!");
this.drivers = GamepadDrivers.forController(joystickId, hidInfo.hidDevice()); this.drivers = GamepadDrivers.forController(joystickId, hidInfo.hidDevice());
this.uniqueDrivers = drivers.getUniqueDrivers(); this.uniqueDrivers = drivers.getUniqueDrivers();