mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/gamepad: bug fix: out of range at hatState on Windows
Closes #2103
This commit is contained in:
parent
7030840efa
commit
1202e66114
@ -736,6 +736,9 @@ func (g *nativeGamepad) buttonValue(button int) float64 {
|
||||
|
||||
func (g *nativeGamepad) hatState(hat int) int {
|
||||
if g.usesDInput() {
|
||||
if hat < 0 || hat >= len(g.dinputHats) {
|
||||
return 0
|
||||
}
|
||||
return g.dinputHats[hat]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user