mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-05 23:44:31 +01:00
internal/gamepad: bug fix: out of range at hatState on Windows
Closes #2103
This commit is contained in:
parent
81ac97a9bd
commit
331dbfd899
@ -736,6 +736,9 @@ func (g *nativeGamepad) buttonValue(button int) float64 {
|
|||||||
|
|
||||||
func (g *nativeGamepad) hatState(hat int) int {
|
func (g *nativeGamepad) hatState(hat int) int {
|
||||||
if g.usesDInput() {
|
if g.usesDInput() {
|
||||||
|
if hat < 0 || hat >= len(g.dinputHats) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
return g.dinputHats[hat]
|
return g.dinputHats[hat]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user