inpututil: bug fix: compile error

This commit is contained in:
Hajime Hoshi 2022-03-25 14:36:34 +09:00
parent e4d0050452
commit 798b60b67c

View File

@ -141,8 +141,8 @@ func (i *inputState) update() {
i.gamepadButtonDurations[id] = make([]int, ebiten.GamepadButtonMax+1)
}
n := ebiten.GamepadButtonNum(id)
if n > ebiten.GamepadButtonMax+1 {
n = ebiten.GamepadButtonMax + 1
if n > int(ebiten.GamepadButtonMax)+1 {
n = int(ebiten.GamepadButtonMax) + 1
}
for b := ebiten.GamepadButton(0); b < ebiten.GamepadButton(n); b++ {
if ebiten.IsGamepadButtonPressed(id, b) {